home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1989 / 04 / extra / griodemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-01-25  |  2.1 KB  |  100 lines

  1.  
  2. (* -------------------------------------------- *)
  3. (*                 GRIODEMO.PAS                 *)
  4. (*     Demo zur Verwendung der Unit GrInOut     *)
  5. (*         (C) 1989 F.Prattes & TOOLBOX         *)
  6. (* -------------------------------------------- *)
  7. PROGRAM GrInOutDemo;
  8. USES
  9.   Crt, Graph, GrInOut;
  10. VAR
  11.   fontno :INTEGER;
  12.   s : STRING;
  13.   zahl : REAL;
  14.  
  15. PROCEDURE Wait;
  16. VAR
  17.   c:CHAR;
  18. BEGIN
  19.   WHILE  KeyPressed DO c := ReadKey;
  20.   REPEAT UNTIL KeyPressed;
  21.   c := ReadKey;
  22.   ClearDevice
  23. END; (* Wait *)
  24.  
  25. PROCEDURE Intro;
  26. VAR
  27.   i, vgr : INTEGER;
  28.  
  29. BEGIN
  30.   i := 0;
  31.   REPEAT
  32.     IF i = SmallFont THEN
  33.       vgr := 5
  34.     ELSE
  35.       vgr := 1;
  36.     SetTextStyle(i, HorizDir, vgr);
  37.     GotoXY(1,1);
  38.     Write('GrInOut-Unit, eine Unit zur');
  39.     WriteLn(' Textausgabe im Graphikmodus');
  40.     WriteLn;
  41.     Write('Dieser Text wird mit normalen Write');
  42.     Write('-Befehlen ausgegeben. Egal, welche ');
  43.     Write('Schriftart Sie waehlen, die Ausgabe');
  44.     Write('routinen in der GrInOut-Unit passen');
  45.     WriteLn(' sich an.');
  46.     WriteLn;
  47.     Write('Mit GotoXY koennen Sie die Position');
  48.     Write(' der Ausgabe bestimmen, ');
  49.     Write('und mit ClrEol bis zum Zeilenende ');
  50.     WriteLn('loeschen.');
  51.     WriteLn;
  52.     Write('Bitte eine Taste druecken...');
  53.     Wait;
  54.     Inc(i)
  55.   UNTIL (i > 4);
  56. END; (* Intro *)
  57.  
  58. PROCEDURE WriteAbc;
  59. VAR
  60.   c : CHAR;
  61. BEGIN
  62.   GotoXY(1,1);
  63.   FOR c:='A' TO 'Z' DO Write(c)
  64. END; (* WriteAbc *)
  65.  
  66. PROCEDURE WriteLines;
  67. VAR
  68.   i : INTEGER;
  69. BEGIN
  70.   GotoXY(1,1);
  71.   Write('MaxPosY: ',GetMaxPosY);
  72.   GotoXY(1,2);
  73.   FOR i:=2 TO GetMaxPosY DO
  74.     WriteLn(i:2,' .Zeile')
  75. END; (* WriteLines *)
  76.  
  77. BEGIN
  78.   InitGraphic;
  79.   Intro;
  80.   FOR fontno := 0 TO 2 DO BEGIN
  81.     SetTextStyle(fontno, HorizDir, fontno*2 + 1);
  82.     WriteAbc;
  83.     Wait;
  84.     WriteLines;
  85.     Wait;
  86.   END;
  87.   SetTextStyle(TriplexFont, HorizDir, 2);
  88.   GotoXY(1,1);
  89.   Write('Ihre Eingabe bitte (String): ');
  90.   ReadLn(s);
  91.   WriteLn('Echo: ',s);
  92.   Write('Ihre Eingabe bitte (Zahl)  : ');
  93.   ReadLn(zahl);
  94.   WriteLn('Echo: ',zahl:10:2);
  95.  
  96.   Write('Bitte eine Taste druecken...');
  97.   Wait;
  98.   LeaveGraphic
  99. END. (* GrInOutDemo *)
  100.