home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / TIPI2A / HELPSTRG.TPI < prev    next >
Text File  |  1994-09-14  |  6KB  |  297 lines

  1. define menu
  2. # ( -- choice)
  3. # ( valid$ -- )
  4. # Returns the chosen key or 0 if the user escapes from this menu
  5.  0 cursor
  6.  ucase$
  7.  27 chr$ swap$ +$
  8.  begin
  9.   inkey$ ucase$ # valid$ key$
  10.   len instr *
  11.   dup
  12.   if dup drop$ endif drop$
  13.  until
  14.  1 -
  15.  1 cursor
  16. enddef
  17.  
  18. define wait
  19.  begin key until cls
  20. enddef
  21.  
  22.  begin cls
  23. |
  24. |   ╔════════════════════════════════════════╗
  25. |   ║ S T R I N G    I N S T R U C T I O N S ║
  26. |   ╠════════════╦══════════════╦════════════╣
  27. |   ║            ║              ║            ║
  28. |   ║ [A] ASC    ║ [H] LEN      ║ [O] STR$   ║
  29. |   ║            ║              ║            ║
  30. |   ║ [B] CHR$   ║ [I] LTRIM$   ║ [P] TIME$  ║
  31. |   ║            ║              ║            ║
  32. |   ║ [C] DATE$  ║ [J] MID$     ║ [Q] UCASE$ ║
  33. |   ║            ║              ║            ║
  34. |   ║ [D] EXE$   ║ [K] PARSE$   ║ [R] VAL    ║
  35. |   ║            ║              ║            ║
  36. |   ║ [E] INSTR  ║ [L] REPLACE$ ║ ["] "      ║
  37. |   ║            ║              ║            ║
  38. |   ║ [F] LCASE$ ║ [M] RIGHT$   ║ [+] +$     ║
  39. |   ║            ║              ║            ║
  40. |   ║ [G] LEFT$  ║ [N] RTRIM$   ║ [=] =$     ║
  41. |   ╚════════════╩══════════════╩════════════╝
  42.  "abcdefghijklmnopqr" 34 chr$ +$ "+=" +$
  43.  menu dup cls
  44.  case 0 of endof
  45.       1 of
  46. |
  47. |   ASC
  48. |   
  49. |   Data Stack:             -- N
  50. |   String Stack:        A$ -- A$
  51. |   
  52. |   Places a number N on the data stack, where N is
  53. |   the ASCII value of the first character of the
  54. |   string on the top of the string stack.
  55. |
  56.         wait
  57.         endof
  58.       2 of
  59. |
  60. |   CHR$
  61. |   
  62. |   Data Stack:          N --
  63. |   String Stack:          -- M$
  64. |   
  65. |   CHR$ converts an integer N from the data stack to
  66. |   an ASCII character and places the single
  67. |   character string on the top of the string stack.
  68. |
  69.         wait
  70.         endof
  71.       3 of
  72. |
  73. |   DATE$
  74. |   
  75. |   Data Stack:            --
  76. |   String Stack:          -- D$
  77. |   
  78. |   Places the current date on the string stack in
  79. |   the form "MM-DD-YYYY"
  80. |
  81.         wait
  82.         endof
  83.       4 of
  84. |
  85. |   EXE$
  86. |   
  87. |   Data Stack:            --
  88. |   String Stack:          -- E$
  89. |   
  90. |   Places the path and name of the currently
  91. |   running EXE on the string stack.
  92. |
  93.         wait
  94.         endof
  95.       5 of
  96. |
  97. |   INSTR
  98. |   
  99. |   Data Stack:                -- n
  100. |   String Stack:        a$ b$ -- a$ b$
  101. |   
  102. |   Searches a$ for the first occurrence of b$. If
  103. |   b$ is in a$, n is the location where b$ starts
  104. |   in a$. If b$ is not in a$, n is zero.
  105. |
  106.         wait
  107.         endof
  108.       6 of
  109. |
  110. |   LCASE$
  111. |   
  112. |   Data Stack:                --
  113. |   String Stack:           A$ -- a$
  114. |   
  115. |   Converts any uppercase characters in A$ to
  116. |   lowercase.
  117. |
  118.         wait
  119.         endof
  120.       7 of
  121. |
  122. |   LEFT$
  123. |   
  124. |   Data Stack:              n --
  125. |   String Stack:           a$ -- l$
  126. |   
  127. |   Returns a string consisting of the n leftmost
  128. |   characters of a$. For example, "This is a test"
  129. |   7 LEFT$ would return "This is".
  130. |
  131.         wait
  132.         endof
  133.       8 of
  134. |
  135. |   LEN
  136. |   
  137. |   Data Stack:                -- len
  138. |   String Stack:           a$ -- a$
  139. |   
  140. |   Places the length of a$ on the data stack.
  141. |
  142.         wait
  143.         endof
  144.       9 of
  145. |
  146. |   LTRIM$
  147. |   
  148. |   Data Stack:                --
  149. |   String Stack:           a$ -- b$
  150. |   
  151. |   Trims any leading blanks from a$.
  152. |
  153.         wait
  154.         endof
  155.      10 of
  156. |
  157. |   MID$
  158. |   
  159. |   Data Stack:           st len --
  160. |   String Stack:             a$ -- b$
  161. |   
  162. |   Returns b$, a string of len characters starting
  163. |   at position st from a$.
  164. |
  165.         wait
  166.         endof
  167.      11 of
  168. |
  169. |   PARSE$
  170. |   
  171. |   Data Stack:                  --
  172. |   String Stack:          text$ -- newtext$ word$
  173. |   
  174. |   Parses the first word from text$.
  175. |
  176.         wait
  177.         endof
  178.      12 of
  179. |
  180. |   REPLACE$
  181. |   
  182. |   Data Stack:                          --
  183. |   String Stack:        text$ old$ new$ -- newtext$
  184. |   
  185. |   Replaces any occurences of old$ in text$ with
  186. |   new$.
  187. |
  188.         wait
  189.         endof
  190.      13 of
  191. |
  192. |   RIGHT$
  193. |   
  194. |   Data Stack:               n --
  195. |   String Stack:            a$ -- b$
  196. |   
  197. |   Returns a string consisting of the n rightmost
  198. |   characters of a$. For example, "This is a test"
  199. |   6 RIGHT$ would return "a test".
  200. |
  201.         wait
  202.         endof
  203.      14 of
  204. |
  205. |   RTRIM$
  206. |   
  207. |   Data Stack:                 --
  208. |   String Stack:            a$ -- b$
  209. |   
  210. |   Removes any trailing blanks from a$.
  211. |
  212.         wait
  213.         endof
  214.      15 of
  215. |
  216. |   STR$
  217. |   
  218. |   Data Stack:              n --
  219. |   String Stack:              -- n$
  220. |   
  221. |   Converts an integer from the data stack to a
  222. |   string. For example, 123 STR$ would place the
  223. |   string "123" on the string stack.
  224. |
  225.         wait
  226.         endof
  227.      16 of
  228. |
  229. |   TIME$
  230. |   
  231. |   Data Stack:                 --
  232. |   String Stack:               -- t$
  233. |   
  234. |   Places the current time (in the form "HH:MM:SS")
  235. |   on the string stack.
  236. |
  237.         wait
  238.         endof
  239.      17 of
  240. |
  241. |   UCASE$
  242. |   
  243. |   Data Stack:                 --
  244. |   String Stack:            a$ -- A$
  245. |   
  246. |   Converts any lowercase letters in a$ to
  247. |   uppercase.
  248. |
  249.         wait
  250.         endof
  251.      18 of
  252. |
  253. |   VAL
  254. |   
  255. |   Data Stack:                 -- n
  256. |   String Stack:            s$ --
  257. |   
  258. |   Converts a string to a number.
  259. |
  260.         wait
  261.         endof
  262.      19 of
  263. |
  264. |     "
  265. |   
  266. |   Data Stack:                 --
  267. |   String Stack:               --
  268. |   
  269. |   Begins and ends a text string.
  270. |
  271.         wait
  272.         endof
  273.      20 of
  274. |
  275. |     +$
  276. |   
  277. |   Data Stack:                  --
  278. |   String Stack:          a$ b$ -- c$
  279. |   
  280. |   Combines a$ and b$ into one string.
  281. |
  282.         wait
  283.         endof
  284.      21 of
  285. |
  286. |     =$
  287. |   
  288. |   Data Stack:                  -- C
  289. |   String Stack:          A$ B$ -- 
  290. |   
  291. |   C is TRUE if A$ equals B$, FALSE otherwise.
  292. |
  293.         wait
  294.         endof
  295.   endcase
  296.  not until
  297.