VOGONS


First post, by Kirirus

User metadata
Rank Newbie
Rank
Newbie

A simple program

Uses Graph; Var GD,GM:integer; Begin GD:=VGA; GM:=2; InitGraph(GD,GM,''); CloseGraph; End. […]
Show full quote

Uses Graph;
Var GD,GM:integer;
Begin
GD:=VGA; GM:=2; InitGraph(GD,GM,'');
CloseGraph;
End.

does not work...

Reply 2 of 6, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

As WD said, you're probably missing the .BGI file in the same folder as your executable, just out of curiosty add

cleardevice;

after initgraph and before closegraph
and

writeln(graphresult);

after closegraph and before end. so you can see what (if anything) went wrong as a numerical result since, at the moment, it's doing nothing and it might indeed be working and you're just simply not noticing (on exit TP restores the CRT mode and it exits right after closegraph; if you want it to wait, add

readln;

after cleardevice, so you can see your wonderful black graphics screen).

Reply 3 of 6, by Kirirus

User metadata
Rank Newbie
Rank
Newbie

The BGI file is present... When I trace the program with F8, it works normally, when i try to start it with Ctrl-F9, DosBox window immediately closes.

System is Win7, when I used XP, all programs worked normally.