home *** CD-ROM | disk | FTP | other *** search
- Program HercUtil_Demo;
-
- {***************************************************************}
- {* Demo-Programm zur Veranschaulichung der Funktionen *}
- {* TestGraph und GetPage *}
- {* von Christian Monien *}
- {* (c) Juli 1990 Verlag Heinz Heise Redaktion c't *}
- {***************************************************************}
-
- Uses Crt, Graph;
-
- Const
- BGIPath = 'c:\tp5\graph'; { ist für den eigenen Bedarf anzupassen }
-
- Var
- GraphDriver : Integer;
- GraphMode : Integer;
- ErrorCode : Integer;
- c : Char;
-
- {$L HercUtil.obj }
-
- Function TestGraph : Boolean; external;
- Function GetPage : Byte; external;
-
- {***************************************************************}
-
- Begin
- GraphDriver:= HercMono;
- GraphMode:= HercMonoHi;
- InitGraph(GraphDriver, GraphMode, BGIPath);
- ErrorCode:= GraphResult;
- If ErrorCode <> grOK then
- Begin
- WriteLn('Graphics error:');
- WriteLn(GraphErrorMsg(ErrorCode));
- WriteLn('Program aborted...');
- Halt(1);
- End;
-
- Repeat
- If TestGraph then
- Begin
- If GetPage = 0 then OutTextXY(100, 40, 'Grafikmodus, Seite 0')
- Else OutTextXY(100, 40, 'Grafikmodus, Seite 1');
- OutTextXY(100, 60, '1 - Textmodus');
- OutTextXY(100, 70, '2 - Grafikmodus, Seite 0');
- OutTextXY(100, 80, '3 - Grafikmodus, Seite 1');
- OutTextXY(100, 90, 'E - Ende');
- End
- Else
- Begin
- GotoXY(10, 3); Write('Textmodus');
- GotoXY(10, 5); Write('1 - Textmodus');
- GotoXY(10, 6); Write('2 - Grafikmodus, Seite 0');
- GotoXY(10, 7); Write('3 - Grafikmodus, Seite 1');
- GotoXY(10, 8); Write('E - Ende');
- End;
-
- Repeat
- c:= UpCase(ReadKey);
- Until c in ['1', '2', '3', 'E'];
- Case c of
- '1': Begin
- RestoreCrtMode;
- ClrScr;
- End;
- '2': Begin
- SetGraphMode(GraphMode);
- SetVisualPage(0);
- SetActivePage(0);
- End;
- '3': Begin
- SetGraphMode(GraphMode);
- SetVisualPage(1);
- SetActivePage(1);
- End;
- End;
- Until c = 'E';
- CloseGraph;
- End.
-
-