home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1989 / 06 / tricks / drucker.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-05-05  |  6.6 KB  |  184 lines

  1. (* ------------------------------------------------------ *)
  2. (*                    DRUCKER.PAS                         *)
  3. (* Utility zur Druckerinitialisierung per Funktionstasten *)
  4. (*       (c)  1989  Siegfried Hund  &  TOOLBOX            *)
  5. (* ------------------------------------------------------ *)
  6. PROGRAM Drucker;  USES Dos, Crt, Printer;
  7.  
  8. VAR
  9.   TEXT  : ARRAY[1..19] OF STRING[57];
  10.   i, x  : INTEGER;
  11.   taste : CHAR;
  12.   mono  : BOOLEAN;
  13.  
  14. PROCEDURE Init;
  15. BEGIN
  16.   TEXT[ 1] := '╔══════════════════════════' +
  17.               '═══════════════════════════╗';
  18.   TEXT[ 2] := '║         Drucker-Installation ' +
  19.               'für XXX-Drucker        ║';
  20.   TEXT[ 3] := '║       (c) 1989  Siegfried Hund' +
  21.               '  &  TOOLBOX          ║';
  22.   TEXT[ 4] := '╟─────────────────────────'+
  23.               '─╥──────────────────────────╢';
  24.   TEXT[ 5] := '║ F1  Zeilenvorschub       '+
  25.               '║ F11 Seitenvorschub       ║';
  26.   TEXT[ 6] := '║ F2  Zeichensatz 1      · '+
  27.               '║ F12 Zeichensatz 2      √ ║';
  28.   TEXT[ 7] := '║ F3  Schönschrift ein   · '+
  29.               '║ F13 Schönschrift aus   · ║';
  30.   TEXT[ 8] := '║ F4  Breitschrift ein   · '+
  31.               '║ F14 Breitschrift aus   · ║';
  32.   TEXT[ 9] := '║ F5  Schmalschrift ein  · '+
  33.               '║ F15 Schmalschrift aus  · ║';
  34.   TEXT[10] := '║ F6  Doppeldruck ein    · '+
  35.               '║ F16 Doppeldruck aus    · ║';
  36.   TEXT[11] := '║ F7  Fettdruck ein      · '+
  37.               '║ F17 Fettdruck aus      · ║';
  38.   TEXT[12] := '║ F8  Unidirekt. Druck   · '+
  39.               '║ F18 Unidirekt. aus     · ║';
  40.   TEXT[13] := '║ F9                     · '+
  41.               '║ F19                    · ║';
  42.   TEXT[14] := '║ F10 Testdruck            '+
  43.               '║ F20 Reset                ║';
  44.   TEXT[15] := '║ ESC Menü verlassen       '+
  45.               '║ ESC Menü verlassen       ║';
  46.   TEXT[16] := '╟──────────────────────────'+
  47.               '╫──────────────────────────╢';
  48.   TEXT[17] := '║ F1 - F10                 '+
  49.               '║ Shift F1 - F10           ║';
  50.   TEXT[18] := '║                          '+
  51.               '║                          ║';
  52.   TEXT[19] := '╚══════════════════════════'+
  53.               '╩══════════════════════════╝';
  54.   x:=2;
  55.   TextBackground(white);  TextColor(red);
  56.   FOR i := 1 TO 19 DO BEGIN
  57.     GotoXY(x,i);  Write(TEXT[i]);
  58.   END;
  59. END;
  60.  
  61. PROCEDURE cursoroff;
  62. VAR  regs : Registers;
  63. BEGIN
  64.   regs.ax := $0100;  regs.cx := $2607;  Intr($10, regs);
  65. END;
  66.  
  67. PROCEDURE cursoron;
  68. VAR  regs : Registers;
  69. BEGIN
  70.   IF mono = FALSE THEN BEGIN
  71.     regs.cx := $0007;  regs.ax := $0100;
  72.   END ELSE BEGIN
  73.     regs.cx := 11 SHL 8;  regs.cx := regs.cx OR 13;
  74.     regs.ax := 1 SHL 8;
  75.   END;
  76.   Intr($10, regs);
  77. END;
  78.  
  79. BEGIN
  80.   Init; cursoroff;
  81.   REPEAT
  82.     taste := ReadKey; IF taste = #0 THEN taste := ReadKey;
  83.     CASE taste OF
  84.       ';' : Write(LST, Chr(10));                      { F1 }
  85.       '<' : BEGIN
  86.               GotoXY(x + 25, 6);  Write('√');
  87.               GotoXY(x + 52, 6);  Write('·');
  88.               Write(LST, Chr(27) + Chr(55));          { F2 }
  89.             END;
  90.       '=' : BEGIN
  91.               GotoXY(x + 25, 7);  Write('√');
  92.               GotoXY(x + 52, 7);  Write('·');
  93.               Write(LST,Chr(27)+Chr(120)+Chr(49));    { F3 }
  94.             END;
  95.       '>' : BEGIN
  96.               GotoXY(x + 25, 8);  Write('√');
  97.               GotoXY(x + 52, 8);  Write('·');
  98.               Write(LST,Chr(27)+Chr(87)+Chr(49));     { F4 }
  99.               END;
  100.       '?' : BEGIN
  101.               GotoXY(x + 25, 9);  Write('√');
  102.               GotoXY(x + 52, 9);  Write('·');
  103.               Write(LST,Chr(15));                     { F5 }
  104.               END;
  105.       '@' : BEGIN
  106.               GotoXY(x + 25,10);  Write('√');
  107.               GotoXY(x + 52,10);  Write('·');
  108.               Write(LST,Chr(27)+Chr(71));             { F6 }
  109.               END;
  110.       'A' : BEGIN
  111.               GotoXY(x + 25,11);  Write('√');
  112.               GotoXY(x + 52,11);  Write('·');
  113.               Write(LST,Chr(27)+Chr(69));             { F7 }
  114.               END;
  115.       'B' : BEGIN
  116.               GotoXY(x + 25,12);  Write('√');
  117.               GotoXY(x + 52,12);  Write('·');
  118.               Write(LST,Chr(27)+Chr(85)+Chr(49));     { F8 }
  119.               END;
  120.       'C' : BEGIN
  121.               GotoXY(x + 25,13);  Write('√');
  122.               GotoXY(x + 52,13);  Write('·');
  123.               Write(LST,Chr(7));                      { F9 }
  124.             END;
  125.       'D' : BEGIN
  126.               Write(LST,' Dies ist der Testdruck '); { F10 }
  127.               Write(LST,Chr(10));
  128.             END;
  129.       'T' : Write(LST,Chr(12));                      { F11 }
  130.       'U' : BEGIN
  131.               GotoXY(x + 25, 6);  Write('·');
  132.               GotoXY(x + 52, 6);  Write('√');
  133.               Write(LST,Chr(27)+Chr(54));            { F12 }
  134.             END;
  135.       'V' : BEGIN
  136.               GotoXY(x + 25, 7);  Write('·');
  137.               GotoXY(x + 52, 7);  Write('√');
  138.               Write(LST,Chr(27)+Chr(120)+Chr(48));   { F13 }
  139.             END;
  140.       'W' : BEGIN
  141.               GotoXY(x + 25, 8);  Write('·');
  142.               GotoXY(x + 52, 8);  Write('√');
  143.               Write(LST,Chr(27)+Chr(85)+Chr(48));    { F14 }
  144.             END;
  145.       'X' : BEGIN
  146.               GotoXY(x + 25, 9);  Write('·');
  147.               GotoXY(x + 52, 9);  Write('√');
  148.               Write(LST,Chr(18));                    { F15 }
  149.             END;
  150.       'Y' : BEGIN
  151.               GotoXY(x + 25,10);  Write('·');
  152.               GotoXY(x + 52,10);  Write('√');
  153.               Write(LST,Chr(27)+Chr(72));            { F16 }
  154.             END;
  155.       'Z' : BEGIN
  156.               GotoXY(x + 25,11);  Write('·');
  157.               GotoXY(x + 52,11);  Write('√');
  158.               Write(LST,Chr(27)+Chr(70));            { F17 }
  159.             END;
  160.       '[' : BEGIN
  161.               GotoXY(x + 25,12);  Write('·');
  162.               GotoXY(x + 52,12);  Write('√');
  163.               Write(LST,Chr(27)+Chr(85)+Chr(48));    { F18 }
  164.             END;
  165.       '\' : BEGIN
  166.               GotoXY(x + 25,13);  Write('·');
  167.               GotoXY(x + 52,13);  Write('√');
  168.               Write(LST,Chr(7));                     { F19 }
  169.             END;
  170.       ']' : BEGIN
  171.               FOR i:=6 TO 13 DO BEGIN                { F20 }
  172.                 GotoXY(x + 25, i);  Write('·');
  173.                 GotoXY(x + 52, i);  Write('·');
  174.               END;
  175.               GotoXY(x + 52, 6);  Write('√');
  176.               Write(LST, Chr(27)+Chr(64));
  177.             END;
  178.     END;
  179.   UNTIL taste = Chr(27);
  180.   cursoron;  TextBackground(black);  TextColor(white);
  181. END.
  182. (* ------------------------------------------------------ *)
  183. (*                Ende von DRUCKER.PAS                    *)
  184.