Moving program to other PC. 
Author Message
 Moving program to other PC.

A friend of mine has made a program in Pascal that uses graphics mode
(graph.tpu). This program works well on his computer, but if he tries it on
another computer it won't enter graphics mode. He has tried to include
graph.tpu and the files in the bgi-directory, but it still doesn't work.
Does anyone know what's wrong?

Harald Kaada



Wed, 18 Jun 1902 08:00:00 GMT  
 Moving program to other PC.

Quote:
> A friend of mine has made a program in Pascal that uses graphics mode
> (graph.tpu). This program works well on his computer, but if he tries it
> on another computer it won't enter graphics mode. He has tried to include
> graph.tpu and the files in the bgi-directory, but it still doesn't work.
> Does anyone know what's wrong?

What error message do you get?


Wed, 18 Jun 1902 08:00:00 GMT  
 Moving program to other PC.

Quote:

> A friend of mine has made a program in Pascal that uses graphics mode
> (graph.tpu). This program works well on his computer, but if he tries it on
> another computer it won't enter graphics mode. He has tried to include
> graph.tpu and the files in the bgi-directory, but it still doesn't work.
> Does anyone know what's wrong?

GRAPH.TPU is compiled into the program, so you don't need to transfer
that.  However, the BGI files should be either transferred along with
the program or linked in (source for linking should be included in the
examples directory for TP -- look around for BGILINK.PAS and
BGIDRIV.PAS).

One possible problem is hard-coding the BGI directory.  It's common to
do something like:

  initgraph (gd,gm,'c:\tp\bgi');

This will work on the system it's written on, but if you move the
program to another system, it will still look in C:\TP\BGI for the BGI
files.

Possibly the best way of dealing with this is using an evironment
variable.  For instance you could do this at a command prompt before
running the program:

set bgipath=c:\tp\bin

And in the program, use:

  initgraph (gd,gm,getenv('BGIPATH'));

That way you can adjust the BGI location without having the program
dependent on a specific location.

Quote:
> Harald Kaada


--
Scott Earnest        | We now return you to our regularly |



Wed, 18 Jun 1902 08:00:00 GMT  
 Moving program to other PC.



Quote:

>Possibly the best way of dealing with this is using an evironment
>variable.  For instance you could do this at a command prompt before
>running the program:

>set bgipath=c:\tp\bin

Note that is actually directory and not path name. I personally use
variable BGI for that.

Quote:

>And in the program, use:

>  initgraph (gd,gm,getenv('BGIPATH'));

>That way you can adjust the BGI location without having the program
>dependent on a specific location.

The novelty of that is that if the variable is not set it returns empty
string and thus looks at the default directory. This is good if you have
both the program and the driver on a floppy and move into a new machine
and just say:

a:
prog

Osmo



Wed, 18 Jun 1902 08:00:00 GMT  
 Moving program to other PC.


says...

Quote:
>A friend of mine has made a program in Pascal that uses graphics mode
>(graph.tpu). This program works well on his computer, but if he tries it on
>another computer it won't enter graphics mode. He has tried to include
>graph.tpu and the files in the bgi-directory, but it still doesn't work.
>Does anyone know what's wrong?

In most cases the problem is that procedures in graph.tpu can't find the
binary graph drivers. They are located in the 'bgi' directory below the
Turbo/Borlad pascal's home dir. (e.g. c:\bp\bgi). If you put the drivers in
the same dir as your app, it's not enough. The graph unit usually requires the
full path. The best solution in this case to link the drivers into the
executable. (See bgilink.pas). But this wastes HD space...

Another possible reason is that BGI drivers can't handle the video card.

BandiT



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. FS: PC/Programming Books

2. Program's don't work on new PC

3. Running pascal program on Highend PC

4. PC Parallel Port Programming

5. Pascal-DOS-program won't run on Windows 98-PC

6. A compiling a Mac program on a PC

7. pc-pc communication

8. PC-PC Comm #2

9. PC-PC Communication

10. memory map for the IBM PC.

11. Moving to newer PC causes my app to fail - why?

12. TurboPascal programs on fast PCs

 

 
Powered by phpBB® Forum Software