home *** CD-ROM | disk | FTP | other *** search
- /* Test of AREXX interface to Terminus 2.0a */
- /* Original by Bill Hogsett. */
- /* Modified for 2.0c by Jack Radigan. */
-
- options failat 10
- options results
- signal on error
-
- 'tpen'
- dtpen = tpen
- 'bpen'
- dbpen = bpen
- top:
- 'cls'
- 'print local "Terminus ARexx demo menu"'
- 'print local "------------------------\n"'
- 'print local "1. Read-only variable tests."'
- 'print local "2. Read/write variable tests."'
- 'print local "3. INPUT, ASK, GETINT and GETSTRING tests."'
- 'print local "4. CLRRECT, CLRLINE GETLINE test."'
- 'print local "0. Exit\n"'
-
- 'ask local "Select a menu option: "'
-
- select
- when result = 1 then signal option1
- when result = 2 then signal option2
- when result = 3 then signal option3
- when result = 4 then signal option4
- when result = 0 then signal option0
- otherwise 'print local "Invalid selection"'
- end
-
- signal top
-
- option1:
- 'cls'
- 'print local "CARRIER test.\n"'
- 'print local " This test requires a modem connected and ready to accept commands. It"'
- 'print local "will use the AT&C command to toggle the DCD line.\n"'
- 'send "at&c0\r"'
- 'wait "OK"'
- 'carrier'
- online = result
- if result = 1 then
- result = true
- else
- result = false
- 'print local "CARRIER is:' result '"'
- 'send "at&c1\r"'
- 'wait "OK"'
- online = result
- if result = 1 then
- result = true
- else
- result = false
- 'print local "CARRIER is:' result '"'
- call getret
-
- 'col'
- ccol = result
- 'row'
- crow = result
- 'print local "\n\nCurrent row: ' crow ' current column: ' ccol '"'
-
- 'cols'
- ccol = result
- 'rows'
- crow = result
- 'ilace'
- if result = 1 then
- lace = on
- else
- lace = off
- 'colors'
- ccolor = result
- 'print local "\nCurrent display is: Interlace - ' lace ' rows: ' crow ' cols: ' ccol ' colors: ' ccolor '"'
-
- 'fontname$'
- name = result
- 'fontheight'
- height = result
- 'print local "\nFont in use is: ' name ' height: ' height '"'
-
- 'date$'
- date = result
- 'time$'
- time = result
- 'print local "\nDate: ' date ' time: ' time '"'
- call getret
- signal top
-
- option2:
- 'cls'
- 'tpen'
- tpenn = result
- 'bpen'
- bpenn = result
- 'cpen'
- cpenn = result
- 'print local "Text: ' tpenn ' Bgnd: ' bpenn ' Cursor: ' cpenn '"'
- 'tpen = 7'
- 'bpen = 6'
- 'print local " Pen change test "'
- 'tpen = ' tpenn
- 'bpen = ' bpenn
- 'print local " Pen restore test"'
- call getret
-
- 'cursor = off'
- 'print local "\nThe cursor should be off"'
- call getret
- 'cursor = on'
- 'print local "\nThe cursor should be on"'
- call getret
-
- 'timer'
- ttimer = result
- 'timer = 120'
- 'print local "\nTimer should be set to 2:00 minutes."'
- call getret
- 'timer = ' ttimer
- 'print local "\nTimer should be reset to original value."'
- call getret
- signal top
-
- option3:
- 'cls'
- 'input local "Enter a line of text: "'
- 'print local "Your response was: ' result '"'
- 'ask local "Press a key:"'
- 'print local "\nYour response was: ' result '"'
- 'getint "Enter a number", 5, 0, 10'
- 'print local "Your response was:' result'"'
- 'getstring "Enter a string", "Test"'
- 'print local "Your response was:' result'"'
- call getret
- signal top
-
- option4:
- 'cls'
- 'print local "\n The following demo will fill rows 10 through 22 with the letter E and"'
- 'print local "then clear a rectangle starting at position 11, 21 to 21, 58.\n"'
- 'move 9, 1'
- 'tpen = 2'
- do i = 1 to 80 by 1
- 'print local ' i // 10';'
- end
-
- 'tpen = 3'
- 'print local'
- 'move 10, 1'
- do i = 10 to 22 by 1
- 'move ' i ', 1'
- 'print local "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"'
- end
-
- 'tpen = ' dtpen
- do i = 10 to 22 by 1
- 'move ' i ', 1'
- 'print local ' i ';'
- end
-
- 'print local'
- 'bpen = 3'
- 'clrrect 11, 21, 21, 58'
- 'bpen = ' dbpen
- call getret
-
- 'cls'
- 'print local " The CLRLINE demo will print a line of E characters at row 4 and will clear"'
- 'print local "a 20 character section starting at column 40.\n"'
- 'move 6, 1'
- do i = 1 to 80 by 1
- 'print local ' i // 10';'
- end
-
- 'move 7, 1'
- 'print local "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"'
- 'move 7, 40'
- 'bpen = 3'
- 'clrline 20'
- 'bpen = ' dbpen
- 'move 9, 1'
- call getret
-
- 'cls'
- 'print local " The INVLINE demo will print a line of E characters at line 4 in inverse"'
- 'print local "colors then will reinvert a 20 character section starting at column 30.\n"'
- 'move 6, 1'
-
- do i = 1 to 80 by 1
- 'print local ' i // 10';'
- end
- 'move 7, 1'
- 'tpen = 2'
- 'bpen = 3'
- 'print local "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE"'
- 'tpen = 3'
- 'bpen = 2'
- 'move 7, 30'
- 'invline 20'
- 'move 9, 1'
- 'tpen = ' dtpen
- 'bpen = ' dbpen
- call getret
-
- 'cls'
- 'print local " The GETLINE$() demo lists some sample files and then inverts the middle line."'
- 'print local "The same line will be printed below the list to indicate that the GETLINE$()"'
- 'print local "worked.\n"'
- 'move 8,1'
- 'print local " FILENAME DATE SIZE"'
- 'print local " ----------------------------"'
- 'print local " test.LZH 1/2/89 72323"'
- 'print local " PIC.ZIP 2/12/90 23232"'
- 'print local " DOC.ARC 12/30/91 97687"'
- 'move 11, 1'
- 'invline'
- 'move 15, 1'
- 'getline$(11)'
- 'print local "'result'"'
-
- call getret
- signal top
-
- option0:
- 'cls'
- 'print local "Terminus ARexx demo finished.\n"'
- exit
-
- end
-
- error:
- 'print local "Error detected!"'
- exit
-
- getret:
- 'ask local "\nPress any key to continue."'
- 'print local'
- return
-
-