home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / TIPI2A / HELPDATA.TPI < prev    next >
Text File  |  1994-09-13  |  1KB  |  63 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.  |   ║ D A T A    I N S T R U C T I O N S ║
  26.  |   ╠══════════════════╦═════════════════╣
  27.  |   ║                  ║                 ║
  28.  |   ║ [A] FETCH        ║ [B] STORE       ║
  29.  |   ╚══════════════════╩═════════════════╝
  30.   "ab" menu dup cls
  31.   case 0 of endof
  32.        1 of
  33. |
  34. |   FETCH
  35. |
  36. |   Data Stack:         v -- x (if numeric)
  37. |   String Stack:         -- x$ (if string)
  38. |
  39. |   Returns the contents of variable v. The type of
  40. |   v (numeric or string) determines if the contents
  41. |   of the fetch is placed on the data or the
  42. |   string stack.
  43. |
  44.     wait
  45.    endof
  46.    2 of
  47. |
  48. |   STORE
  49. |
  50. |   Data Stack:         n v -- (if numeric)    v -- (if string)
  51. |   String Stack:           --                s$ --
  52. |
  53. |   Stores a value into a variable. The type of v
  54. |   (numeric or string) determines if the contents
  55. |   of the store is taken from the data or the string
  56. |   stack.
  57. |
  58.     wait
  59.    endof
  60.   endcase
  61.   not
  62.  until
  63.