home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
DIVERSEN
/
TIPI2A
/
HELPMISC.TPI
< prev
next >
Wrap
Text File
|
1994-09-24
|
5KB
|
259 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
|
| ╔══════════════════════════════════════════════════════╗
| ║ M I S C E L L A N E O U S I N S T R U C T I O N S ║
| ╠══════════════╦═══════════════╦═══════════════════════╣
| ║ ║ ║ ║
| ║ [A] BIT? ║ [G] NOT ║ [M] TRUE ║
| ║ ║ ║ ║
| ║ [B] BYE ║ [H] OFF ║ [N] VERSION ║
| ║ ║ ║ ║
| ║ [C] ERROR ║ [I] RANDOM ║ [#] # ║
| ║ ║ ║ ║
| ║ [D] EVAL ║ [J] RANDOMIZE ║ [(] ( ║
| ║ ║ ║ ║
| ║ [E] FALSE ║ [K] TICKS ║ [)] ) ║
| ║ ║ ║ ║
| ║ [F] MACHINE? ║ [L] TIMEOUT ║ ║
| ╚══════════════╩═══════════════╩═══════════════════════╝
"abcdefghijklmn#()" menu dup cls
case 0 of endof
1 of
|
| BIT?
|
| Data Stack: number bit -- flag
| String Stack: --
|
| Returns true if bit is set in number.
|
wait
endof
2 of
|
| BYE
|
| Data Stack: n --
| String Stack: --
|
| Exits a TIPI program and returns to DOS. BYE
| returns the top value from the data stack as an
| error level to DOS.
|
wait
endof
3 of
|
| ERROR
|
| Data Stack: -- n
| String Stack: --
|
| Places the number of the current error on the
| data stack.
|
wait
endof
4 of
|
| EVAL
|
| Data Stack: -- ?
| String Stack: I$ -- ?
|
| Evaluates the instruction I$ from the string
| stack.
|
wait
endof
5 of
|
| FALSE
|
| Data Stack: -- 0
| String Stack: --
|
| Places the value of FALSE (0) on the top of the
| data stack.
|
wait
endof
6 of
|
| MACHINE?
|
| Data Stack: -- n
| String Stack: --
|
| Returns a number identifying the computer TIPI
| is running on according to the following table.
|
| 0 = PC
| 1 = HP95LX
| 2 = HP100LX
|
wait
endof
7 of
|
| NOT
|
| Data Stack: n -- m
| String Stack: --
|
| Negates the truth value of a flag. If n is
| non-zero, m is zero. If n is zero, m is one.
|
wait
endof
8 of
|
| OFF
|
| Data Stack: --
| String Stack: --
|
| Shuts off an HP palmtop computer.
| OFF has no effect on a PC.
|
wait
endof
9 of
|
| RANDOM
|
| Data Stack: N -- R
| String Stack: --
|
| Replaces N on the data stack with R, a random
| integer selected from the range 1 to N
| (inclusive).
|
wait
endof
10 of
|
| RANDOMIZE
|
| Data Stack: --
| String Stack: --
|
| Initializes the random number generator.
|
wait
endof
11 of
|
| TICKS
|
| Data Stack: -- t
| String Stack: --
|
| Places the current PC tick count on the data
| stack. A PC ticks 18.2 times per second.
|
wait
endof
12 of
|
| TIMEOUT
|
| Data Stack: T --
| String Stack: --
|
| Controls the auto-timeout feature of the HP
| palmtops. If T=0, auto-timeout is disabled. If
| T is in the range 1 to 65535, the timout is set
| to that many ticks (a tick=55 msecs).
|
| Notes:
| 1) The power-up default value for T is 3276
| (3 minutes).
| 2) If the main batteries are low, the maximum
| timeout value will be one minute.
|
wait
endof
13 of
|
| TRUE
|
| Data Stack: -- 1
| String Stack: --
|
| Places the constant 1 on the top of the data
| stack.
|
wait
endof
14 of
|
| VERSION
|
| Data Stack: -- N
| String Stack: --
|
| VERSION leaves an integer N on the data stack.
| N is equal to the version number times ten (ie
| if N is 23 then the TIPI version number is 2.3).
|
wait
endof
15 of
|
| #
|
| Data Stack: --
| String Stack: --
|
| Identifies a comment. Anything after the # on a
| line is ignored.
|
wait
endof
16 of
|
| (
|
| Data Stack: --
| String Stack: --
|
| Begins a comment.
|
wait
endof
17 of
|
| )
|
| Data Stack: --
| String Stack: --
|
| Ends a comment.
|
wait
endof
endcase
not until