Language:
Русский
English
{Grfreslt.PAS}
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
{Sample code for the GraphResult function.}
uses Graph;
var
ErrorCode: Integer;
GrDriver, GrMode: Integer;
begin
GrDriver := Detect;
InitGraph(GrDriver, GrMode, '');
ErrorCode := GraphResult; { Check for errors }
if ErrorCode <> grOk then
begin
Writeln('Graphics error:');
Writeln(GraphErrorMsg(ErrorCode));
Writeln('Program aborted...');
Halt(1);
end;
ClearDevice; { Do some graphics... }
Rectangle(0, 0, GetMaxX, GetMaxY);
Readln;
CloseGraph;
end.