home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
DIVERSEN
/
TIPI2A
/
HELPIO.TPI
< prev
next >
Wrap
Text File
|
1994-09-24
|
14KB
|
653 lines
define menu
# ( -- choice)
# ( valid$ -- )
# Returns the chosen key or 0 if the user escapes from this menu
0 cursor
ucase$
27 chr$ swap$ +$
begin
inkey$ ucase$ # valid$ key$
len instr *
dup
if dup drop$ endif drop$
until
1 -
1 cursor
enddef
define wait
begin key until cls
enddef
begin cls
|
| ╔══════════════════════════════════════════════════════════╗
| ║ I / O I N S T R U C T I O N S ║
| ╠═════════════╦══════════════╦══════════════╦══════════════╣
| ║ [A] BEEP ║ [M] CURSOR ║ [Y] ISINPUT ║ [!] PRINTCHR ║
| ║ [B] BLOAD ║ [N] DEFSEG ║ [Z] ISOUTPUT ║ [@] PRINTER ║
| ║ [C] BSAVE ║ [O] EOF ║ [1] KEY ║ [#] PRINT$ ║
| ║ [D] CLOSE ║ [P] EXTENDED ║ [2] LF ║ [$] PUTBYTE ║
| ║ [E] CLS ║ [Q] FILEPOS ║ [3] LOCATE ║ [%] PUTPORT ║
| ║ [F] COLOR ║ [R] GETBYTE ║ [4] MOUSE ║ [^] ROW ║
| ║ [G] COLOR? ║ [S] GETNUM ║ [5] OPEN ║ [&] SETVOL ║
| ║ [H] COLUMN ║ [T] GETPORT ║ [6] OPENCOM ║ [*] SOUND ║
| ║ [I] COMSTAT ║ [U] GETVOL ║ [7] OUTPORT ║ [+] VARPTR ║
| ║ [J] CONSOLE ║ [V] GET$ ║ [8] PEEK ║ [|] | ║
| ║ [K] CR ║ [W] INKEY$ ║ [9] POKE ║ ║
| ║ [L] CURRENT ║ [X] INPORT ║ [0] PRINT ║ ║
| ╚═════════════╩══════════════╩══════════════╩══════════════╝
"abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*+|" menu dup cls
case 0 of endof
1 of
|
| BEEP
|
| Data Stack: --
| String Stack: --
|
| Produces a short beep.
|
wait
endof
2 of
|
| BLOAD
|
| Data Stack: addr count --
| String Stack: file$ --
|
| Loads count bytes of data to addr from file$.
| Addr is an address in the current segment.
|
wait
endof
3 of
|
| BSAVE
|
| Data Stack: addr count --
| String Stack: file$ --
|
| Saves count bytes from addr to file$. Addr is an
| address in the current segment.
|
wait
endof
4 of
|
| CLOSE
|
| Data Stack: N --
| String Stack: --
|
| Closes file N. N should be either a 1 or a 2.
|
wait
endof
5 of
|
| CLS
|
| Data Stack: --
| String Stack: --
|
| Clears the screen and places the cursor in the
| upper left corner.
|
wait
endof
6 of
|
| COLOR
|
| Data Stack: Foreground Background --
| String Stack: --
|
| Sets the foreground and background colors of the
| screen for subsequent prints. Colors are as
| follows: 0 Black, 1 Blue, 2 Green, 3 Cyan, 4 Red,
| 5 Magenta, 6 Brown, 7 Gray, 8 Dark Gray,
| 9 Lt. Blue, 10 Lt. Green, 11 Lt. Cyan,
| 12 Lt. Red, 13 Lt. Magenta, 14 Yellow, 15 White.
|
| Notes --
| 1) Background colors 8 to 15 result in
| blinking text.
|
wait
endof
7 of
|
| COLOR?
|
| Data Stack: -- flag
| String Stack: --
|
| Returns TRUE if a color card is detected, FALSE
| if a monochrome card is detected.
|
wait
endof
8 of
|
| COLUMN
|
| Data Stack: -- col
| String Stack: --
|
| Places the column of the current cursor
| position on the data stack.
|
wait
endof
9 of
|
| COMSTAT
|
| Data Stack: port -- status
| String Stack: --
|
| Returns the status of a com port. Port should be
| 1 or 2. Status bits as follows:
| Bit 0 Delta CTS, Bit 1 Delta DSR, Bit 2 RD,
| Bit 3 Delta receive line signal detect, Bit 4
| CTS, Bit 5 DSR, Bit 6 Ring Indicator, Bit 7
| Received line signal detect, Bit 8 Data Ready,
| Bit 9 Overrun error, Bit 10 Parity Error, Bit 11
| Framing error, Bit 12 Break detect error, Bit 13
| Transfer holding register empty, Bit 14 Transfer
| shift register empty, Bit 15 Time-out,error.
|
wait
endof
10 of
|
| CONSOLE
|
| Data Stack: -- 0
| String Stack: --
|
| Places the constant 0 on the data stack. The
| CONSOLE instruction is used for clarity. For
| example, the sequence CONSOLE ISINPUT is much
| clearer than 0 ISINPUT.
|
wait
endof
11 of
|
| CR
|
| Data Stack: --
| String Stack: --
|
| Sends a carriage return to the current output
| device.
|
wait
endof
12 of
|
| CURRENT
|
| Data Stack: -- -2
| String Stack: --
|
| Places the constant -2 on the data stack.
| CURRENT is used for clarity. For example,
| 1 CURRENT FILEPOS is much clearer than
| 1 -2 FILEPOS.
|
wait
endof
13 of
|
| CURSOR
|
| Data Stack: N --
| String Stack: --
|
| If N is zero, the cursor will be made invisible.
| If N is non-zero, the cursor will be made
| visible. WARNING! Don't execute a 1 CURSOR unless
| you have already executed at least one 0 CURSOR.
|
wait
endof
14 of
|
| DEFSEG
|
| Data Stack: N --
| String Stack: --
|
| DEFSEG is used to define the data segment used
| in subsequent PEEK and POKE instructions. If N
| is -1, the data segment is set back to TIPI's
| default data segment address.
|
wait
endof
15 of
|
| EOF
|
| Data Stack: -- -1
| String Stack: --
|
| Places the constant -1 on the data stack. EOF is
| used for clarity. For example, 1 EOF FILEPOS is
| much clearer than 1 -1 FILEPOS.
|
wait
endof
16 of
|
| EXTENDED
|
| Data Stack: -- n
| String Stack: --
|
| Returns the contents of the system variable
| EXTENDED. This is used in conjunction with
| INKEY$. EXTENDED will be 0 if a "normal" key is
| pressed, 1 if an "extended" key is pressed.
|
wait
endof
17 of
|
| FILEPOS
|
| Data Stack: filenum action -- loc
| String Stack: --
|
| FILEPOS is used to position and read the value
| of a file pointer. The filenum is a previously
| opened file number (1 or 2) and the action is
| either EOF, CURRENT or a specific location. The
| number loc returned on the data stack is the
| location in the file where the next action will
| occur. EOF moves the pointer to the end of the
| file, CURRENT keeps it at its current position
| and any other number moves the pointer to that
| location in the file.
|
wait
endof
18 of
|
| GETBYTE
|
| Data Stack: filenum -- byte
| String Stack: --
|
| Gets a single byte from a file whose filenumber
| is filenum. The file must have been previously
| opened and filenum must be either 1 or 2.
|
wait
endof
19 of
|
| GETNUM
|
| Data Stack: -- n
| String Stack: --
|
| Gets a number from the current input device.
|
wait
endof
20 of
|
| GETPORT
|
| Data Stack: Port -- Byte
| String Stack: --
|
| Gets a Byte from a serial port. Port may be
| either 1 or 2, specifying COM1 or COM2.
|
wait
endof
21 of
|
| GETVOL
|
| Data Stack: -- Vol
| String Stack: --
|
| Gets the system sound volume on an HP100LX. Vol
| may vary from 0 (silent) to 3 (loudest).
|
wait
endof
22 of
|
| GET$
|
| Data Stack: --
| String Stack: -- string$
|
| Gets a string from the current input device.
|
wait
endof
23 of
|
| INKEY$
|
| Data Stack: --
| String Stack: -- k$
|
| Scans the keyboard and returns a one character
| string. If no key is pressed, k$ is null (""),
| otherwise k$ is the character whose key was
| pressed. If an extended key was pressed, the
| system variable EXTENDED is set to TRUE.
|
wait
endof
24 of
|
| INPORT
|
| Data Stack: Port -- Byte
| String Stack: --
|
| Gets a Byte from a specific hardware port. This
| is used to read joysticks, etc.
|
wait
endof
25 of
|
| ISINPUT
|
| Data Stack: n --
| String Stack: --
|
| Sets the current input device to n, where n is
| either file number 1 or 2 or the CONSOLE. The
| CONSOLE is device 0.
|
wait
endof
26 of
|
| ISOUTPUT
|
| Data Stack: n --
| String Stack: --
|
| Sets the current output device to n, where n is
| either filenumber 1 or 2, the PRINTER or the
| CONSOLE. The CONSOLE is device 0 and the
| PRINTER is device 3.
|
wait
endof
27 of
|
| KEY
|
| Data Stack: -- k
| String Stack: --
|
| Scans the keyboard and returns a keycode. If no
| key is pressed, k is 0.
|
wait
endof
28 of
|
| LF
|
| Data Stack: --
| String Stack: --
|
| Sends a line feed to the current output device.
|
wait
endof
29 of
|
| LOCATE
|
| Data Stack: row col --
| String Stack: --
|
| Places the cursor at row, col.
|
wait
endof
30 of
|
| MOUSE
|
| Data Stack: AX BX CX DX -- AX BX CX DX
| String Stack: --
|
| Calls the low-level mouse interupt. See MOUSE.TPI
| for examples.
|
wait
endof
31 of
|
| OPEN
|
| Data Stack: N --
| String Stack: T$ F$ --
|
| Opens a file. N is the file number and N may be
| either a 1 or a 2. T$ is the type of open and
| T$ may be either "I", "O", "A" or "R" which
| stand for Input, Output, Append or Random
| respectively. F$ is the name of the file to open.
|
wait
endof
32 of
|
| OPENCOM
|
| Data Stack: Baud Parity Stop Size Port --
| String Stack: --
|
| Initializes the serial port. Use settings
| from the following tables.
|
| Baud Parity
| Value Description Value Description
| ------------------ ------------------
| 0 110 baud 0 None
| 1 150 baud 1 Odd
| 2 300 baud 3 Even
| 3 600 baud
| 4 1200 baud
| 5 2400 baud
| 6 4800 baud
| 7 9600 baud
|
| Stop may be 1 or 2, Port may be 1 or 2, Size may
| be either 7 or 8 bits.
|
wait
endof
33 of
|
| OUTPORT
|
| Data Stack: Byte Port --
| String Stack: --
|
| Sends a Byte out to a port. Port should be in
| the range 0 to 255.
|
wait
endof
34 of
|
| PEEK
|
| Data Stack: Addr -- Byte
| String Stack: --
|
| Places the contents of Addr on the data stack.
| Addr is an address in the current segment. To
| change the current segment, use DEFSEG.
|
wait
endof
35 of
|
| POKE
|
| Data Stack: Addr Byte --
| String Stack: --
|
| Pokes Byte into Addr. Addr is an address in the
| current segment. To change the current segment,
| use DEFSEG.
|
wait
endof
36 of
|
| PRINT
|
| Data Stack: n --
| String Stack: --
|
| Prints the number n on the current output
| device.
|
wait
endof
37 of
|
| PRINTCHR
|
| Data Stack: c --
| String Stack: --
|
| Prints the character whose ASCII code is c on
| the current output device.
|
wait
endof
38 of
|
| PRINTER
|
| Data Stack: -- 3
| String Stack: --
|
| Places the constant 3 on the data stack. The
| PRINTER instruction is used for clarity. For
| example, the sequence PRINTER ISOUTPUT is much
| clearer than 3 ISOUTPUT.
|
wait
endof
39 of
|
| PRINT$
|
| Data Stack: --
| String Stack: a$ --
|
| Prints the string a$ on the current output
| device.
|
wait
endof
40 of
|
| PUTBYTE
|
| Data Stack: B F --
| String Stack: --
|
| Outputs byte B to file F.
|
wait
endof
41 of
|
| PUTPORT
|
| Data Stack: Byte ComPort --
| String Stack: --
|
| Sends a Byte to ComPort 1 or 2
|
wait
endof
42 of
|
| ROW
|
| Data Stack: -- row
| String Stack: --
|
| Places the row of the current cursor position on
| the data stack.
|
wait
endof
43 of
|
| SETVOL
|
| Data Stack: Vol --
| String Stack: --
|
| Sets the sound volume on an HP100LX. Vol may
| vary from 0 (silent) to 3 (loudest).
|
wait
endof
44 of
|
| SOUND
|
| Data Stack: freq dur --
| String Stack: --
|
| Plays a sound of a given freq and dur. Frequency
| is in Hertz and duration is in Milliseconds.
|
wait
endof
45 of
|
| VARPTR
|
| Data Stack: V -- A
| String Stack: --
|
| Places the address of a variable onto the data
| stack. This may be used to PEEK and POKE values
| directly into a variable.
|
wait
endof
46 of
|
| |
|
| Data Stack: --
| String Stack: --
|
| Prints the rest of the current line out to the
| current output device.
|
wait
endof
endcase
not until