graph unit

when i work with the graph unit, and compile the pas to an .exe file, it works only if its in the same dir as the tp7 compiler...
how can i make it to work on any dir or on any computer that doesnt have to have tp7 installed, so i can send my file to my friends...
any ideas ?
thanks
must!!


Comments

  • The problem most likely lies with InitGraph. The .exe looks for bgi and chr files, but knows where to find them only on your machine. I can think of three ways around this:

    (1)The help file describes a method of linking BGI into your program. I've never done this myself, but it might be worth a try. Your program will no longer need any extra files for graphics.

    (2)Don't use graph at all. My personal favourate. Work with BIOS, or - even better - directly with the VGA card and video memory at segmant $A000, if you know how.

    (3)This is probably what you're looking for, since you won't need to change your program much. You most likely have a line somewhere in your program which looks something like this:
    InitGraph(driver, mode, 'f: pgi');
    Change this to
    InitGraph(driver, mode, '');
    and, when you pass the program around, make sure to copy all the .bgi and .chr files (or at least all the ones your program uses) from the tpgi directory to the same directory as the .exe file. The program should work fine as long as the .exe, .bgi and .chr files are together.

    : when i work with the graph unit, and compile the pas to an .exe file, it works only if its in the same dir as the tp7 compiler...
    : how can i make it to work on any dir or on any computer that doesnt have to have tp7 installed, so i can send my file to my friends...
    : any ideas ?
    : thanks
    : must!!
    :
    :


  • : (1)The help file describes a method of linking BGI into your program. I've never done this myself, but it might be worth a try. Your program will no longer need any extra files for graphics.

    thats why i want to do...
    the help file tells me link it to my program, it doesnt tell me how to link it... or i'm just stupid...
    thanks
    any idea on how can i link it ?
    must


  • : : (1)The help file describes a method of linking BGI into your program. I've never done this myself, but it might be worth a try. Your program will no longer need any extra files for graphics.
    :
    : thats why i want to do...
    : the help file tells me link it to my program, it doesnt tell me how to link it... or i'm just stupid...
    : thanks
    : any idea on how can i link it ?
    : must
    :
    :
    There is a complete working example, which comes with tp7. Its path is "EXAMPLESBGI" in your pascal directory.

    If it is not there, you can ask me for it.

  • thanks!!
    must....

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories