How to compile a BGI file
Author Message
How to compile a BGI file

Hello, me again =]

I wrote a Pascal file, with the line : initgraph(Gd, Gm,'C:\utils\bgi');

well, now i'd like to compile this file, but if i copmiled it and
run it on another computer, it asks 4 the BGI directory,
which is logic, but how can i avoid this ??

Wed, 18 Jun 1902 08:00:00 GMT
How to compile a BGI file

Quote:

> Hello, me again =]

> I wrote a pascal file, with the line : initgraph(Gd, Gm,'C:\utils\bgi');

> well, now i'd like to compile this file, but if i copmiled it and
> run it on another computer, it asks 4 the BGI directory,
> which is logic, but how can i avoid this ??

In the EXAMPLES\BGI directory you can find the file BGILINK.PAS, which

Wouter

Wed, 18 Jun 1902 08:00:00 GMT
How to compile a BGI file

Quote:

>I wrote a pascal file, with the line : initgraph(Gd, Gm,'C:\utils\bgi');

InitGraph(Driver,Mode,' ');

Use this line instead and put your .BGI file to same directory with

Aarne

-\ Aarne Toompark \ Tel&Fax (372) 65 65 110 \-

Quote for the day:
Mental backup in progress- Do Not Disturb!

Wed, 18 Jun 1902 08:00:00 GMT
How to compile a BGI file

Quote:
>Hello, me again =]

>I wrote a pascal file, with the line : initgraph(Gd, Gm,'C:\utils\bgi');

>well, now i'd like to compile this file, but if i copmiled it and
>run it on another computer, it asks 4 the BGI directory,
>which is logic, but how can i avoid this ??

Never hard code directory names. Instead use for example environment
variable to tell the directory.

Osmo

Wed, 18 Jun 1902 08:00:00 GMT
How to compile a BGI file
hello
another solution(not better) is to input your pathdriver on the other
computer,if there are the bgi and chr files,when you run the program
something like this :
pathdriver:='';
repeat
initgraph(gd,gm,pathdriver);
errorcode:=graphresult;
if errorcode <> grok
then
begin
writeln('graphics error :', grapherrormsg(errorcode));
if errorcode=grfilenotfound
then
begin
writeln('imput the path of the bgi');
writeln;
end
else halt(1);
end;
until errorcode=grok) ;

Quote:
>Hello, me again =]

>I wrote a pascal file, with the line : initgraph(Gd, Gm,'C:\utils\bgi');

>well, now i'd like to compile this file, but if i copmiled it and
>run it on another computer, it asks 4 the BGI directory,
>which is logic, but how can i avoid this ??

Wed, 18 Jun 1902 08:00:00 GMT
How to compile a BGI file
: Hello, me again =]
:
: I wrote a pascal file, with the line : initgraph(Gd, Gm,'C:\utils\bgi');
:
: well, now i'd like to compile this file, but if i copmiled it and
: run it on another computer, it asks 4 the BGI directory,
: which is logic, but how can i avoid this ??
:
:

Some time ago I wrote a program to convert *.BGI & *.CHR files to *.TPU ones.