home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
DIVERSEN
/
TIPI2A
/
HELPSTRG.TPI
< prev
next >
Wrap
Text File
|
1994-09-14
|
6KB
|
297 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
|
| ╔════════════════════════════════════════╗
| ║ S T R I N G I N S T R U C T I O N S ║
| ╠════════════╦══════════════╦════════════╣
| ║ ║ ║ ║
| ║ [A] ASC ║ [H] LEN ║ [O] STR$ ║
| ║ ║ ║ ║
| ║ [B] CHR$ ║ [I] LTRIM$ ║ [P] TIME$ ║
| ║ ║ ║ ║
| ║ [C] DATE$ ║ [J] MID$ ║ [Q] UCASE$ ║
| ║ ║ ║ ║
| ║ [D] EXE$ ║ [K] PARSE$ ║ [R] VAL ║
| ║ ║ ║ ║
| ║ [E] INSTR ║ [L] REPLACE$ ║ ["] " ║
| ║ ║ ║ ║
| ║ [F] LCASE$ ║ [M] RIGHT$ ║ [+] +$ ║
| ║ ║ ║ ║
| ║ [G] LEFT$ ║ [N] RTRIM$ ║ [=] =$ ║
| ╚════════════╩══════════════╩════════════╝
"abcdefghijklmnopqr" 34 chr$ +$ "+=" +$
menu dup cls
case 0 of endof
1 of
|
| ASC
|
| Data Stack: -- N
| String Stack: A$ -- A$
|
| Places a number N on the data stack, where N is
| the ASCII value of the first character of the
| string on the top of the string stack.
|
wait
endof
2 of
|
| CHR$
|
| Data Stack: N --
| String Stack: -- M$
|
| CHR$ converts an integer N from the data stack to
| an ASCII character and places the single
| character string on the top of the string stack.
|
wait
endof
3 of
|
| DATE$
|
| Data Stack: --
| String Stack: -- D$
|
| Places the current date on the string stack in
| the form "MM-DD-YYYY"
|
wait
endof
4 of
|
| EXE$
|
| Data Stack: --
| String Stack: -- E$
|
| Places the path and name of the currently
| running EXE on the string stack.
|
wait
endof
5 of
|
| INSTR
|
| Data Stack: -- n
| String Stack: a$ b$ -- a$ b$
|
| Searches a$ for the first occurrence of b$. If
| b$ is in a$, n is the location where b$ starts
| in a$. If b$ is not in a$, n is zero.
|
wait
endof
6 of
|
| LCASE$
|
| Data Stack: --
| String Stack: A$ -- a$
|
| Converts any uppercase characters in A$ to
| lowercase.
|
wait
endof
7 of
|
| LEFT$
|
| Data Stack: n --
| String Stack: a$ -- l$
|
| Returns a string consisting of the n leftmost
| characters of a$. For example, "This is a test"
| 7 LEFT$ would return "This is".
|
wait
endof
8 of
|
| LEN
|
| Data Stack: -- len
| String Stack: a$ -- a$
|
| Places the length of a$ on the data stack.
|
wait
endof
9 of
|
| LTRIM$
|
| Data Stack: --
| String Stack: a$ -- b$
|
| Trims any leading blanks from a$.
|
wait
endof
10 of
|
| MID$
|
| Data Stack: st len --
| String Stack: a$ -- b$
|
| Returns b$, a string of len characters starting
| at position st from a$.
|
wait
endof
11 of
|
| PARSE$
|
| Data Stack: --
| String Stack: text$ -- newtext$ word$
|
| Parses the first word from text$.
|
wait
endof
12 of
|
| REPLACE$
|
| Data Stack: --
| String Stack: text$ old$ new$ -- newtext$
|
| Replaces any occurences of old$ in text$ with
| new$.
|
wait
endof
13 of
|
| RIGHT$
|
| Data Stack: n --
| String Stack: a$ -- b$
|
| Returns a string consisting of the n rightmost
| characters of a$. For example, "This is a test"
| 6 RIGHT$ would return "a test".
|
wait
endof
14 of
|
| RTRIM$
|
| Data Stack: --
| String Stack: a$ -- b$
|
| Removes any trailing blanks from a$.
|
wait
endof
15 of
|
| STR$
|
| Data Stack: n --
| String Stack: -- n$
|
| Converts an integer from the data stack to a
| string. For example, 123 STR$ would place the
| string "123" on the string stack.
|
wait
endof
16 of
|
| TIME$
|
| Data Stack: --
| String Stack: -- t$
|
| Places the current time (in the form "HH:MM:SS")
| on the string stack.
|
wait
endof
17 of
|
| UCASE$
|
| Data Stack: --
| String Stack: a$ -- A$
|
| Converts any lowercase letters in a$ to
| uppercase.
|
wait
endof
18 of
|
| VAL
|
| Data Stack: -- n
| String Stack: s$ --
|
| Converts a string to a number.
|
wait
endof
19 of
|
| "
|
| Data Stack: --
| String Stack: --
|
| Begins and ends a text string.
|
wait
endof
20 of
|
| +$
|
| Data Stack: --
| String Stack: a$ b$ -- c$
|
| Combines a$ and b$ into one string.
|
wait
endof
21 of
|
| =$
|
| Data Stack: -- C
| String Stack: A$ B$ --
|
| C is TRUE if A$ equals B$, FALSE otherwise.
|
wait
endof
endcase
not until