home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / KAND / CTJUTIL1.ZIP / CONTROL.COM / CONTROL3.CLA < prev    next >
Text File  |  1988-08-13  |  9KB  |  230 lines

  1.          MEMBER('CONTROLS')
  2.  
  3. UPDATEPRT PROCEDURE(MODE)             !ADD, DELETE, CHANGE PROCEDURE
  4.  
  5. MODE         BYTE
  6.  
  7. PRTENTER     SCREEN      WINDOW(8,43),AT(13,20),HLP('NEWPRNT'),HUE(6,0,0)
  8.            ROW(1,1)      STRING('╔═{41}╗')
  9.            ROW(2,1)      REPEAT(6);STRING('║<0{41}>║') .
  10.            ROW(8,1)      STRING('╚═{41}╝')
  11.            ROW(3,3)      STRING('Printer Name:')
  12.          COL(17)  ENTRY(@S8),USE(PRINTER),HUE(7,0),SEL(31,0),REQ,LFT,UPR
  13.            ROW(5,4)      STRING('Description:')
  14.          COL(17)  ENTRY(@S25),USE(DESCRIP),HUE(7,0),SEL(31,0),REQ,LFT,UPR
  15.            ROW(7,13)  PAUSE('Press F10 to Accept'),USE(?DONE),HUE(17,2)
  16.          .
  17.  
  18.   EJECT
  19.  
  20. DELWIN         SCREEN      WINDOW(3,59),AT(23,12),HUE(7,0,0)
  21.            ROW(1,1)      STRING('╔═{57}╗'),HUE(29,0)
  22.            ROW(2,1)      STRING('║<0{57}>║'),HUE(29,0)
  23.            ROW(3,1)      STRING('╚═{57}╝'),HUE(29,0)
  24.            ROW(2,2)      PAUSE('PRESS F10 TO DELETE THIS RECORD OR ANY OTHER KEY TO ABORT')|
  25.                 USE(?DEL),HUE(14,0)
  26.          .
  27.  
  28. CODESCR         SCREEN      WINDOW(25,80),HLP('CONFIG'),HUE(14,1)
  29.            ROW(24,2)  PAINT(1,79),HUE(10,0)
  30.            ROW(24,1)  PAINT(2,1),HUE(10,0)
  31.            ROW(1,1)      STRING('┌─{21}┤<0{38}>├─{17}┐'),HUE(4,1)
  32.            ROW(2,1)      STRING('├─{39}┬─{38}┤'),HUE(4,1)
  33.            ROW(3,1)      REPEAT(20);STRING('│<0{39}>│<0{38}>│'),HUE(4,1) .
  34.            ROW(23,1)  STRING('└─{39}┴─{38}┘'),HUE(4,1)
  35.            ROW(25,56) STRING('<24,0,25>'),HUE(13,0)
  36.            ROW(1,34)  STRING('-'),HUE(13,1)
  37.            ROW(3,12)  STRING('DP Mode:')
  38.          COL(42)  STRING('Cancel Condensed'),HUE(14,1)
  39.          COL(58)  STRING(':')
  40.            ROW(4,12)  STRING('LQ Mode:')
  41.          COL(44)  STRING('Backspace Char:')
  42.            ROW(5,5)      STRING('Double Wide ON:')
  43.          COL(50)  STRING('Linefeed:')
  44.            ROW(6,16)  STRING('OFF:')
  45.          COL(50)  STRING('Formfeed:')
  46.            ROW(7,5)      STRING('Double High ON:')
  47.          COL(43)  STRING('Carriage return:')
  48.            ROW(8,16)  STRING('OFF:')
  49.          COL(51)  STRING('LF + CR:')
  50.            ROW(9,7)      STRING('Underline ON:')
  51.          COL(51)  STRING('LF Only:')
  52.            ROW(10,16) STRING('OFF:')
  53.          COL(51)  STRING('CR Only:')
  54.            ROW(11,8)  STRING('Boldface ON:')
  55.          COL(51)  STRING('CR + LF:')
  56.            ROW(12,16) STRING('OFF:')
  57.          COL(43)  STRING('Unidirect print:')
  58.            ROW(13,6)  STRING('Overstrike ON:')
  59.          COL(44)  STRING('Bidirect print:')
  60.            ROW(14,16) STRING('OFF:')
  61.          COL(45)  STRING('Printer reset:')
  62.            ROW(15,5)  STRING('Superscript ON:')
  63.          COL(55)  STRING('   '),HUE(14,1)
  64.          COL(58)  STRING(':')
  65.            ROW(16,7)  STRING('Subscript ON:')
  66.          COL(43)  STRING('Reserved for   '),HUE(14,1)
  67.          COL(58)  STRING(':')
  68.            ROW(17,3)  STRING('Sup/Subscrpt OFF:')
  69.          COL(46)  STRING('Future Use  '),HUE(14,1)
  70.          COL(58)  STRING(':')
  71.            ROW(18,9)  STRING('Italics ON:')
  72.          COL(44)  STRING(' {14}'),HUE(14,1)
  73.          COL(58)  STRING(':')
  74.            ROW(19,8)  STRING('Italics OFF:')
  75.          COL(51)  STRING(' {7}'),HUE(14,1)
  76.          COL(58)  STRING(':')
  77.            ROW(20,5)  STRING('10 CPI (Pica) :')
  78.          COL(52)  STRING(' {6}'),HUE(14,1)
  79.          COL(58)  STRING(':')
  80.            ROW(21,5)  STRING('12 CPI (Elite):')
  81.          COL(45)  STRING('Reverse Print'),HUE(14,1)
  82.          COL(58)  STRING(':')
  83.            ROW(22,3)  STRING('17 CPI(compress):')
  84.          COL(42)  STRING(' Cancel Rev. Prt'),HUE(14,1)
  85.          COL(58)  STRING(':')
  86.            ROW(25,2)  STRING('F1'),HUE(13,0)
  87.          COL(4)      STRING(' = Help {6}'),HUE(10,0)
  88.          COL(17)  STRING('F9'),HUE(13,0)
  89.          COL(19)  STRING(' = Exit {6}'),HUE(10,0)
  90.          COL(32)  STRING('F10'),HUE(13,0)
  91.          COL(35)  STRING(' = Save and Exit {5}'),HUE(10,0)
  92.          COL(57)  STRING(' '),HUE(10,0)
  93.          COL(59)  STRING(' = move highlight bar '),HUE(10,0)
  94. MODEL           ROW(1,25)  STRING(8),HUE(11,1)
  95. DESC         COL(36)  STRING(25),HUE(11,1)
  96.               REPEAT(20,2),EVERY(1,39),INDEX(NDX)
  97.            ROW(3,20)    POINT(1,21),USE(?POINT),SEL(0,7),REQ
  98. HARDSPC         COL(20)    STRING(1),HUE(7,1)
  99.          COL(21)    ENTRY(@N3B),USE(C1),HUE(7,1),INS,NUM
  100.          COL(25)    ENTRY(@N3B),USE(C2),HUE(7,1),INS,NUM
  101.          COL(29)    ENTRY(@N3B),USE(C3),HUE(7,1),INS,NUM
  102.          COL(33)    ENTRY(@N3B),USE(C4),HUE(7,1),INS,NUM
  103.          COL(37)    ENTRY(@N3B),USE(C5),HUE(7,1),INS,NUM
  104.          .          .
  105.  
  106. NDX      BYTE                     !REPEAT INDEX VARIABLE
  107. GROUP      GROUP,DIM(40)                 !40 DIMENSION ARRAY GROUP
  108. CGRP        GROUP                 !  CODE GROUP
  109. C1          BYTE                 !    CODE 1
  110. C2          BYTE                 !    CODE 2
  111. C3          BYTE                 !    CODE 3
  112. C4          BYTE                 !    CODE 4
  113. C5          BYTE                 !    CODE 5
  114.         .                     !  END CODE GROUP
  115. TEMPCODE  STRING(5),OVER(CGRP)             !REDECLARE BYTE GROUP AS STRING
  116.       .                     !END GROUP
  117.  
  118.   CODE
  119.   CASE MODE                     !IF MODE PASSED IS
  120.   OF ENTER                     !ADD MODE
  121.     DO GETPRT                     !GET PRINTER NAME & DESCRIPTION
  122.     IF KEYCODE() = F9_KEY THEN RETURN.         !IF F9 WAS PRESSED RETURN TO CALLER
  123.     OPEN(CODESCR)                 !OPEN THE CODE SCREEN
  124.     MODEL = PRINTER                 !DISPLAY PRINTER
  125.     DESC = DESCRIP                 !DISPLAY DESCRIPTION
  126.     DESC = CENTER(DESC)                 !CENTER DESCRIPTION
  127.     LOOP NDX = 1 TO 40                 !LOOP THRU THE REPEAT
  128.       GROUP[NDX] = ALL('<0>')             !  PUT NULLS IN CODE GROUP
  129.       HARDSPC = CHR(255)             !  PUT A HARD SPACE (SO POINT BAR WILL STOP)
  130.     .                         !END LOOP
  131.     LOOP                     !LOOP THRU CODES
  132.       ALERT(F9_KEY,F10_KEY)             !ALERT F9 AND F10 KEYS
  133.       ACCEPT                     !ACCEPT THE FIELD
  134.       ALERT()                     !RESET ALERT KEYS
  135.       IF KEYCODE() = F9_KEY THEN RETURN.     !IF F9 WAS PRESSED RETURN TO CALLER
  136.       CASE FIELD()                 !CHECK WHICH FIELD
  137.       OF ?C1                     !IF IT'S
  138.       OROF ?C2                     !  A
  139.       OROF ?C3                     !   CODE
  140.       OROF ?C4
  141.       OROF ?C5
  142.     IF CONTENTS(?) = 0             !  AND 0 (ENTER) WAS PRESSED
  143.       PRTCODE[NDX] = TEMPCODE[NDX]         !MOVE CODE TO RECORD AREA
  144.       SELECT(?POINT)             !    SELECT THE POINT BAR
  145.       CYCLE                     !    RESTART THE LOOP
  146.       . .                     !END CASE, IF
  147.       PRTCODE[NDX] = TEMPCODE[NDX]         !MOVE CODE TO RECORD AREA
  148.       IF KEYCODE() = F10_KEY THEN BREAK.     !IF F10 WAS PRESSED, BREAK OUT OF LOOP
  149.     .                         !END LOOP
  150.     PUT(PRTFILE)                 !REWRITE THE RECORD (ADDED IN GETPRT)
  151.     IF ERROR() THEN STOP('UNEXPECTED ERROR').     !CHECK FOR ERROR
  152.  
  153.   OF CHANGE                     !CHANGE MODE
  154.     OPEN(CODESCR)                 !OPEN CODE SCREEN
  155.     MODEL = PRINTER                 !DISPLAY PRINTER
  156.     DESC = DESCRIP                 !DISPLAY DESCRIPTION
  157.     DESC = CENTER(DESC)                 !CENTER DESCRIPTION
  158.     LOOP NDX = 1 TO 40                 !LOOP THRU CODES
  159.       GROUP[NDX] = PRTCODE[NDX]             !  MOVE FROM RECORD TO LOCAL GROUP
  160.       HARDSPC = CHR(255)             !  ASSIGN THE HARD SPACE (FOR POINT TO STOP)
  161.       DISPLAY(?C1,?C5)                 !  DISPLAY THE CODES
  162.     .                         !END LOOP
  163.     LOOP                     !LOOP THRU THE SCREEN
  164.       ALERT(F9_KEY,F10_KEY)             !  ALERT F9 AND F10 KEYS
  165.       ACCEPT                     !  ACCEPT A FIELD
  166.       ALERT()                     !RESET ALERT KEYS
  167.       IF KEYCODE() = F9_KEY THEN RETURN.     !IF F9 WAS PRESSED RETURN TO CALLER
  168.       CASE FIELD()                 !CHECK WHICH FIELD
  169.       OF ?C1                     !IF IT'S
  170.       OROF ?C2                     !  A
  171.       OROF ?C3                     !   CODE
  172.       OROF ?C4
  173.       OROF ?C5
  174.     IF CONTENTS(?) = 0             !  AND 0 (ENTER) WAS PRESSED
  175.       PRTCODE[NDX] = TEMPCODE[NDX]         !MOVE CODE TO RECORD AREA
  176.       SELECT(?POINT)             !    SELECT THE POINT BAR
  177.       CYCLE                     !    RESTART THE LOOP
  178.       . .                     !END CASE, IF
  179.       PRTCODE[NDX] = TEMPCODE[NDX]         !MOVE CODE TO RECORD AREA
  180.       IF KEYCODE() = F10_KEY THEN BREAK.     !IF F10 WAS PRESSED, BREAK OUT OF L
  181.     .                         !END LOOP
  182.     PUT(PRTFILE)                 !REWRITE THE RECORD
  183.     IF ERROR() THEN STOP('UNEXPECTED ERROR').     !CHECK FOR ERROR
  184.  
  185.   OF REMOVE                     !DELETE MODE
  186.     OPEN(CODESCR)                 !OPEN CODE SCREEN
  187.     MODEL = PRINTER                 !DISPLAY PRINTER
  188.     DESC = DESCRIP                 !DISPLAY DESCRIPTION
  189.     DESC = CENTER(DESC)                 !CENTER DESCRIPTION
  190.     LOOP NDX = 1 TO 40                 !LOOP THRU CODES
  191.       GROUP[NDX] = PRTCODE[NDX]             !  MOVE FROM RECORD TO LOCAL GROUP
  192.       HARDSPC = CHR(255)             !  ASSIGN THE HARD SPACE (FOR POINT TO STOP)
  193.       DISPLAY(?C1,?C5)                 !  DISPLAY THE CODES
  194.     .                         !END LOOP
  195.     OPEN(DELWIN)                 !OPEN DELETE WINDOW
  196.     ALERT(F9_KEY,F10_KEY)             !ALERT F9 AND F10 KEYS
  197.     ACCEPT                     !ACCEPT A FIELD
  198.     ALERT()                     !RESET ALERT KEYS
  199.     CASE KEYCODE()                 !CHECK KEY PRESSED
  200.     OF F10_KEY                     !IF IT WAS F10
  201.       DELETE(PRTFILE)                 !  DELETE THE PRINTER RECORD
  202.     ELSE                     !OTHERWISE
  203.       CLOSE(DELWIN)                 !  CLOSE THE WINDOW
  204.       RETURN                     !  RETURN TO CALLER
  205.   . .                         !END CASE, CASE
  206.  
  207. GETPRT      ROUTINE                 !GET PRINTER INFORMATION
  208.   OPEN(PRTENTER)                 !OPEN INFO WINDOW
  209.   ERASE                         !ERASE THE FIELDS
  210.   CODEGRP = ALL('<0>')                 !PUT NULLS IN RECORD AREA
  211.   LOOP                         !LOOP THRU THE FIELDS
  212.     ALERT(F9_KEY,F10_KEY)             !  ALERT F9 AND F10 KEYS
  213.     ACCEPT                     !  ACCEPT A FIELD
  214.     ALERT()                     !  RESET ALERT KEYS
  215.     IF KEYCODE() = F9_KEY             !  IF F9 WAS PRESSED
  216.       CLOSE(PRTENTER)                 !    CLOSE THE WINDOW
  217.       EXIT                     !    EXIT ROUTINE
  218.     .                         !  END IF
  219.     CASE FIELD()                 !  CHECK FIELD ENTERED
  220.     OF ?DONE                     !  IF PAUSE FIELD
  221.       IF KEYCODE() <> F10_KEY             !    IF F10 WAS NOT PRESSED
  222.     BEEP                     !    SOUND THE SPEAKER
  223.     SELECT(?)                 !    STAY ON THE SAME FIELD
  224.     CYCLE                     !    RESTART THE LOOP
  225.       ELSE                     !    OTHERWISE
  226.     ADD(PRTFILE)                 !    ADD NEW RECORD
  227.     CLOSE(PRTENTER)                 !    CLOSE THE WINDOW
  228.     EXIT                     !    EXIT THE ROUTINE
  229.   . . .                         !END LOOP, CASE, IF
  230.