I got a problem in Pascal 
Author Message
 I got a problem in Pascal

And here it is.

When I have converted my programs to and exe format.  I try running it and
it says

BGI Error: Graphics not initialized (use InitGraph)

can anyone please reply to me and help me fix this problem.

thank you
cya
Paul
--



Wed, 18 Jun 1902 08:00:00 GMT  
 I got a problem in Pascal

Quote:

>When I have converted my programs to and exe format.  I try running it and
>it says
>BGI Error: Graphics not initialized (use InitGraph)

Simply put the egavga.bgi file into directory
where you keep your exe file.

Konrad
     _/_/  _/_/  _/_/     _/_/_/
    _/_/ _/     _/_/   _/     _/
   _/_/_/             _/     _/
  _/_/  _/_/   _/_/    _/_/_/

     Technical University of Lodz



Wed, 18 Jun 1902 08:00:00 GMT  
 I got a problem in Pascal



Quote:
> And here it is.

> When I have converted my programs to and exe format.  I try running it
and
> it says

> BGI Error: Graphics not initialized (use InitGraph)

> can anyone please reply to me and help me fix this problem.

You are trying to use a function or procedure from the Graph unit without
first initializing the graph, you need to do this at program
initialization.
uses Graph;

var
 grDriver: Integer;
 grMode: Integer;
 ErrCode: Integer;
begin
 grDriver := Detect;
 InitGraph(grDriver, grMode,' ');
 ErrCode := GraphResult;
 if ErrCode = grOk then
 begin  { Do graphics }
   Line(0, 0, GetMaxX, GetMaxY);
   Readln;
   CloseGraph;
 end
 else
   Writeln('Graphics error:', GraphErrorMsg(ErrCode));
end.

--
----------------------------------------------------------------------------
----

?  http://www.ici.net/cust_pages/mrealm/BANDP.HTM ?
----------------------------------------------------------------------------
-----
' It is better to die on your feet, than to live on your knees! '



Wed, 18 Jun 1902 08:00:00 GMT  
 I got a problem in Pascal

Quote:

> And here it is.

> When I have converted my programs to and exe format.  I try running it and
> it says

> BGI Error: Graphics not initialized (use InitGraph)

> can anyone please reply to me and help me fix this problem.

> thank you
> cya
> Paul
> --


If you're using bgi-graphics (which you are, otherwise the error
wouldn't occur) you'll have to make sure you initialize the graphics
mode correctly and that the bgi-file you're using is in the right
(probably the current) directory. To prevent such problems you can
either decide to not use bgi-drivers or to link them into your exe-file.
There should be some docs about this somewhere in the package (look for
files called bgidriv.*). You could also download the SMGRAF-tpu from the
URL below which already has the EGAVGA-bgi linked in.
You'll probably will get lots of replies stating that you shouldn't use
bgi-drivers at all, which is correct but in case you insist this should
help you out (bgi is a fast way to pick up graphics programming with
often slow results).

Remco de Korte
Soft Machine
Nederland
http://www.xs4all.nl/~remcodek/download.html



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

 Relevant Pages 

1. Problem getting data from Excel

2. TQuery Problem with Getting No Data

3. TDBLookupCombo Problem - First Item Gets Duplicated?

4. Problem getting database name in object inspector

5. SQL (D2) problem -- getting two copies of each rown

6. Problem getting date going to DOS from TP

7. Problems getting command.com's date and time with TP6

8. Problem getting SpeedPascal/2 demo

9. Problem getting TableDef from Oracle

10. Problem - Getting Capability not supported

11. Problems getting started with a PostgreSQL database in Delphi 6 using Zeos

12. Turbo Pascal gets 100% Windows NT CPU

 

 
Powered by phpBB® Forum Software