home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / clarion / alerttec.zip / ALERTTEC.CLA next >
Text File  |  1990-09-18  |  13KB  |  229 lines

  1. !■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2. !■  Description:  Shows the use of ALERT() within a program.                ■
  3. !■                                                                          ■
  4. !■       Author:  Sam W. Jacobs, CET                                        ■
  5. !■                Total Electronics Co., Inc. (TEC, Inc.)                   ■
  6. !■                (c) Copyright 1990 - TEC, Inc.                            ■
  7. !■                                                                          ■
  8. !■                                                                          ■
  9. !■      Program:  AlertTec                                                  ■
  10. !■                                                                          ■
  11. !■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  12. alerttec                  program
  13.  
  14. f2_key       EQUATE(2050)                        !F2 key ───┐
  15. f3_key       EQUATE(2051)                        !F3 key    │
  16. f4_key       EQUATE(2052)                        !F4 key    │ These Equates
  17. f5_key       EQUATE(2053)                        !F5 key    │ are normally
  18. f6_key       EQUATE(2054)                        !F6 key    │ found in the
  19. f7_key       EQUATE(2055)                        !F7 key    │ Clarion file
  20. f8_key       EQUATE(2056)                        !F8 key    │ std_keys.cla
  21. f9_key       EQUATE(2057)                        !F9 key    │
  22. f10_key      EQUATE(2058)                        !F10 key ──┘
  23.  
  24. black        SCREEN       HUE(7,0,0)
  25.              .
  26. screen       SCREEN       WINDOW(25,80),AT(1,1),HUE(11,0,0)
  27.                ROW(25,1)  PAINT(1,80),HUE(15,4)
  28.                ROW(25,8)  PAINT(1,1),HUE(15,0)
  29.                ROW(25,16) PAINT(1,1),HUE(15,0)
  30.                ROW(25,24) PAINT(1,1),HUE(15,0)
  31.                ROW(25,32) PAINT(1,1),HUE(15,0)
  32.                ROW(25,40) PAINT(1,1),HUE(15,0)
  33.                ROW(25,48) PAINT(1,1),HUE(15,0)
  34.                ROW(25,56) PAINT(1,1),HUE(15,0)
  35.                ROW(25,64) PAINT(1,1),HUE(15,0)
  36.                ROW(25,72) PAINT(1,1),HUE(15,0)
  37.                ROW(7,13)  PAINT(11,56),HUE(15,1)
  38.                ROW(25,4)  PAINT(1,4),HUE(14,4)
  39.                ROW(1,26)  PAINT(1,31),HUE(15,0)
  40.                ROW(23,62) PAINT(1,18),HUE(0,3)
  41.                ROW(23,2)  PAINT(1,17),HUE(0,3)
  42.                ROW(1,1)   STRING('┌─{23}<0{33}>─{22}┐'),HUE(14,0)
  43.                ROW(2,1)   REPEAT(3),EVERY(2);STRING('│<0{78}>│'),HUE(14,0) .
  44.                ROW(3,1)   STRING('│<0{27}>═{24}<0{27}>│'),HUE(14,0)
  45.                ROW(5,1)   REPEAT(2),EVERY(2);STRING('│<0{78}>│'),HUE(14,0) .
  46.                ROW(8,1)   STRING('│<0{12}>█{16}<0{3}>█{16}<0{3}>█{16}<0{12}>│')   |
  47.                             HUE(14,0)
  48.                ROW(9,1)   REPEAT(4),EVERY(2)
  49.                             STRING('│<0{19}>██<0{10}>██<0{17}>██<0{26}>│')        |
  50.                             HUE(14,0) .
  51.                ROW(10,1)  REPEAT(2),EVERY(4)
  52.                             STRING('│<0{19}>██<0{10}>██<0{17}>██<0{26}>│')        |
  53.                             HUE(14,0) .
  54.                ROW(12,1)  STRING('│<0{19}>██<0{10}>█{11}<0{8}>██<0{26}>│')        |
  55.                             HUE(14,0)
  56.                ROW(16,1)  STRING('│<0{19}>██<0{10}>█{16}<0{3}>█{16}<0{12}>│')     |
  57.                             HUE(14,0)
  58.                ROW(17,1)  REPEAT(7);STRING('│<0{78}>│'),HUE(14,0) .
  59.                ROW(24,1)  STRING('└─{78}┘'),HUE(14,0)
  60.                ROW(6,11)  REPEAT(2),EVERY(12);STRING('█{60}'),HUE(12,0) .
  61.                ROW(7,11)  REPEAT(11);STRING('██<0{56}>██'),HUE(12,0) .
  62.                ROW(1,26)  STRING('Total Electronics Company, Inc.')
  63.                ROW(2,29)  STRING('Alert() Key Demonstation')
  64.                ROW(23,3)  STRING('Press Q to Quit')
  65.                  COL(63)  STRING('Press R to Reset')
  66.                ROW(25,1)  STRING('F1')
  67.                  COL(4)   STRING('Help')
  68.                  COL(9)   STRING('F2')
  69.                  COL(17)  STRING('F3')
  70.                  COL(25)  STRING('F4')
  71.                  COL(33)  STRING('F5')
  72.                  COL(41)  STRING('F6')
  73.                  COL(49)  STRING('F7')
  74.                  COL(57)  STRING('F8')
  75.                  COL(65)  STRING('F9')
  76.                  COL(73)  STRING('F10')
  77.                ROW(2,2)   ENTRY(@S1),USE(f),HLP('alerttec'),HUE(0,0),SEL(0,0),OVR |
  78.                             IMM,NUM
  79. f2_label       ROW(25,12) STRING(4),HUE(14,4)
  80. f3_label         COL(20)  STRING(4),HUE(14,4)
  81. f4_label         COL(28)  STRING(4),HUE(14,4)
  82. f5_label         COL(36)  STRING(4),HUE(14,4)
  83. f6_label         COL(44)  STRING(4),HUE(14,4)
  84. f7_label         COL(52)  STRING(4),HUE(14,4)
  85. f8_label         COL(60)  STRING(4),HUE(14,4)
  86. f9_label         COL(68)  STRING(4),HUE(14,4)
  87. f10_label        COL(77)  STRING(4),HUE(14,4)
  88. message        ROW(21,2)  STRING(78),HUE(12,0)
  89.              .
  90. non_key      SCREEN       WINDOW(1,80),AT(25,1),HUE(15,4,0)
  91.                ROW(1,16)  PAINT(1,12),HUE(14,4)
  92.                ROW(1,31)  PAINT(1,1),HUE(14,4)
  93.                ROW(1,37)  PAINT(1,5),HUE(14,4)
  94.                ROW(1,68)  PAINT(1,1),HUE(14,4)
  95.                ROW(1,74)  PAINT(1,4),HUE(14,4)
  96.                  COL(1)   STRING('Please Press A')
  97.                  COL(16)  STRING('Function Key')
  98.                  COL(28)  STRING(', "')
  99.                  COL(31)  STRING('R')
  100.                  COL(32)  STRING('" to')
  101.                  COL(37)  STRING('RESET')
  102.                  COL(43)  STRING('Function Key Labels, or "')
  103.                  COL(68)  STRING('Q')
  104.                  COL(69)  STRING('" to')
  105.                  COL(74)  STRING('QUIT')
  106.                  COL(79)  STRING('!!')
  107.              .
  108. goodbye      SCREEN       WINDOW(25,80),AT(1,1),HUE(11,0,0)
  109.                ROW(7,13)  PAINT(11,56),HUE(15,1)
  110.                ROW(23,2)  PAINT(1,17),HUE(15,4)
  111.                ROW(1,1)   STRING('┌─{23}<0{33}>─{22}┐'),HUE(14,0)
  112.                ROW(2,1)   REPEAT(6);STRING('│<0{78}>│'),HUE(14,0) .
  113.                ROW(8,1)   STRING('│<0{12}>█{16}<0{3}>█{16}<0{3}>█{16}<0{12}>│')   |
  114.                             HUE(14,0)
  115.                ROW(9,1)   REPEAT(4),EVERY(2)
  116.                             STRING('│<0{19}>██<0{10}>██<0{17}>██<0{26}>│')        |
  117.                             HUE(14,0) .
  118.                ROW(10,1)  REPEAT(2),EVERY(4)
  119.                             STRING('│<0{19}>██<0{10}>██<0{17}>██<0{26}>│')        |
  120.                             HUE(14,0) .
  121.                ROW(12,1)  STRING('│<0{19}>██<0{10}>█{11}<0{8}>██<0{26}>│')        |
  122.                             HUE(14,0)
  123.                ROW(16,1)  STRING('│<0{19}>██<0{10}>█{16}<0{3}>█{16}<0{12}>│')     |
  124.                             HUE(14,0)
  125.                ROW(17,1)  REPEAT(7);STRING('│<0{78}>│'),HUE(14,0) .
  126.                ROW(24,1)  STRING('└─{78}┘'),HUE(14,0)
  127.                ROW(6,11)  REPEAT(2),EVERY(12);STRING('█{60}'),HUE(12,0) .
  128.                ROW(7,11)  REPEAT(11);STRING('██<0{56}>██'),HUE(12,0) .
  129.                ROW(1,26)  STRING('Total Electronics Company, Inc.')
  130.                ROW(2,29)  STRING('Alert() Key Demonstation')
  131.                ROW(3,35)  STRING('P.O. Box 333')
  132.                ROW(4,28)  STRING('Pleasant Unity, Pa.  15676')
  133.                ROW(23,6)  STRING('Q Pressed')
  134.                  COL(36)  STRING('Thank you !')
  135.              .
  136. f            string(1)                 !one char string
  137.  code                                  !begin code
  138.  help('alerttec.hlp')                  !help file
  139.  open(black)                           !open blank, black screen
  140.  open(screen)                          !open screen
  141.  do reset_f                            !alert all keys
  142.  loop                                  !program loop
  143.   accept                               !accept input
  144.   case field()                         !of dummy field
  145.    of ?f                               !of function
  146.      if upper(f)='Q'                   !if Q for Quit
  147.        close(screen)                   !close the screen
  148.        open(goodbye)                   !open screen
  149.        beep(0,500)                     !pause 5 seconds
  150.        return                          !DOS
  151.      elsif upper(f)='R'                !RESET
  152.        do reset_f                      !reset function keys
  153.        do clr_alert                    !clear all labels
  154.      elsif keycode()=f2_key            !if F2 pressed
  155.        f2_label='Hot!'                 !label
  156.        message=center('F2 is now Alerted, Keys F3 to F10 are Invalid',78)
  157.        alert                           !clear alerted keys
  158.        alert(f2_key)                   !alert f2
  159.      elsif keycode()=f3_key            !if F3 pressed
  160.        f3_label='Hot!'                 !label
  161.        message=center('F3 is now Alerted, Keys F2 and F4 to F10 are Invalid',78)
  162.        alert                           !clear alerted keys
  163.        alert(f3_key)                   !alert f3
  164.      elsif keycode()=f4_key            !if F4 pressed
  165.        f4_label='Hot!'                 !label
  166.        message=center('F4 is now Alerted, F2, F3, and F5 to F10 are Invalid',78)
  167.        alert                           !clear alerted keys
  168.        alert(f4_key)                   !alert f4
  169.      elsif keycode()=f5_key            !if F5 pressed
  170.        f5_label='Hot!'                 !label
  171.        message=center('F5 is now Alerted, F2 to F4 and F6 to F10 are Invalid',78)
  172.        alert                           !clear alerted keys
  173.        alert(f5_key)                   !alert f5
  174.      elsif keycode()=f6_key            !if F6 pressed
  175.        f6_label='Hot!'                 !label
  176.        message=center('F6 is now Alerted, F2 to F5 and F7 to F10 are Invalid',78)
  177.        alert                           !clear alerted keys
  178.        alert(f6_key)                   !alert f6
  179.      elsif keycode()=f7_key            !if F7 pressed
  180.        f7_label='Hot!'                 !label
  181.        message=center('F7 is now Alerted, F2 to F6 and F8 to F10 are Invalid',78)
  182.        alert                           !clear alerted keys
  183.        alert(f7_key)                   !alert f7
  184.      elsif keycode()=f8_key            !if F8 pressed
  185.        f8_label='Hot!'                 !label
  186.        message=center('F8 is now Alerted, F2 to F7 and F9 and F10 are Invalid',78)
  187.        alert                           !clear alerted keys
  188.        alert(f8_key)                   !alert f8
  189.      elsif keycode()=f9_key            !if F9 pressed
  190.        f9_label='Hot!'                 !label
  191.        message=center('F9 is now Alerted, F2 to F8 and F10 are Invalid',78)
  192.        alert                           !clear alerted keys
  193.        alert(f9_key)                   !alert f9
  194.      elsif keycode()=f10_key           !if F10 pressed
  195.        f10_label='Hot!'                !label
  196.        message=center('F10 is now Alerted, F2 to F9 are Invalid',78)
  197.        alert                           !clear alerted keys
  198.        alert(f10_key)                  !alert f10
  199.      else                              !else
  200.        open(non_key)                   !open error scr
  201.        beep(700,35);beep(200,50)       !fog horn
  202.        beep(0,300)                     !pause 3 seconds
  203.        close(non_key)                  !close error scr
  204.        message=center('Please Press A Function Key To Test or "Q" to Quit',78)
  205.        cycle                           !loop without double beep
  206.      end                               !if
  207.      f=''                              !clear
  208.      beep(1400,15);beep(1400,15)       !accept beep
  209.   end                                  !case
  210.   cycle                                !loop with beep
  211.  end                                   !loop
  212.  
  213. clr_alert    routine                   !set alert labels
  214.   f2_label=''                          !clear screen labels
  215.   f3_label=''                          !       │
  216.   f4_label=''                          !       │
  217.   f5_label=''                          !       │
  218.   f6_label=''                          !       │
  219.   f7_label=''                          !       │
  220.   f8_label=''                          !       │
  221.   f9_label=''                          !       │
  222.   f10_label=''                         !<──────┘
  223.   exit                                 !routine
  224.  
  225. reset_f      routine                   !sets all keys and message
  226.  alert(f2_key,f10_key)                 !alert all keys
  227.  message=center('Please Press A Function Key To Test or "Q" to Quit',78)
  228.  exit                                  !return
  229.