home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / DIVERSEN / TIPI2A / HELPDOS.TPI < prev    next >
Text File  |  1994-09-13  |  4KB  |  195 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 O S    I N S T R U C T I O N S ║
  26. |   ╠════════════════╦═════════════════╣
  27. |   ║                ║                 ║
  28. |   ║ [A] CALL       ║ [G] KILL        ║
  29. |   ║                ║                 ║
  30. |   ║ [B] CHDIR      ║ [H] MAKEDIR     ║
  31. |   ║                ║                 ║
  32. |   ║ [C] COMMAND$   ║ [I] NEXTFILE    ║
  33. |   ║                ║                 ║
  34. |   ║ [D] ENV$       ║ [J] REMDIR      ║
  35. |   ║                ║                 ║
  36. |   ║ [E] FIRSTFILE  ║ [K] RENAME      ║
  37. |   ║                ║                 ║
  38. |   ║ [F] GETDIR     ║                 ║
  39. |   ╚════════════════╩═════════════════╝
  40.  "abcdefghijk" menu dup cls
  41.  case 0 of endof
  42.       1 of
  43. |
  44. |   CALL
  45. |
  46. |   Data Stack:                               --
  47. |   String Stack:             program$ param$ --
  48. |
  49. |   Calls a DOS program (programs) with the
  50. |   parameter given in param$. Sets ERROR to 255 if
  51. |   the call is unsuccessful. Otherwise ERROR is set
  52. |   to zero unless the called DOS program returns
  53. |   its own error code. Call COMMAND.COM to run
  54. |   batch files.
  55. |
  56.         wait
  57.         endof
  58.       2 of
  59. |
  60. |   CHDIR
  61. |
  62. |   Data Stack:                --
  63. |   String Stack:         dir$ --
  64. |
  65. |   Changes the current DOS directory to the one
  66. |   specified by the top string on the string stack.
  67. |
  68.         wait
  69.         endof
  70.       3 of
  71. |
  72. |   COMMAND$
  73. |
  74. |   Data Stack:           --
  75. |   String Stack:         -- Command$
  76. |
  77. |   Places a string on the string stack consisting
  78. |   of what followed the word TIPI on the DOS
  79. |   command line when TIPI was invoked.
  80. |
  81.         wait
  82.         endof
  83.       4 of
  84. |
  85. |   ENV$
  86. |
  87. |   Data Stack:          N --
  88. |   String Stack:          -- E$
  89. |
  90. |   ENV$ retrieves DOS environment strings. N
  91. |   identifies which string to retrieve. If the
  92. |   string is not found, a null string ("") is
  93. |   returned. If the environment string is longer
  94. |   than 80 characters, TIPI will only return the
  95. |   first 80 characters in the string.
  96. |
  97.         wait
  98.         endof
  99.       5 of
  100. |
  101. |   FIRSTFILE
  102. |
  103. |   Data Stack:                   --
  104. |   String Stack:       filespec$ -- fname$
  105. |
  106. |   Finds the first file that matches filespec$.
  107. |   Filespec$ follows the standard DOS wildcard
  108. |   rules (ie the filespec can contain "*" or "?"
  109. |   characters).
  110. |
  111.         wait
  112.         endof
  113.       6 of
  114. |
  115. |   GETDIR
  116. |
  117. |   Data Stack:          num --
  118. |   String Stack:            -- dir$
  119. |
  120. |   GETDIR is used to get the current directory. If
  121. |   num = 0 then GETDIR returns the directory of the
  122. |   current drive. If num is 1 GETDIR uses the A
  123. |   drive, 2 uses the B drive etc. The directory
  124. |   returned does NOT contain the drive letter or the
  125. |   first "\". Thus, if the current directory is the
  126. |   root directory, 0 GETDIR will return a null
  127. |   string ("").
  128. |
  129.         wait
  130.         endof
  131.       7 of
  132. |
  133. |   KILL
  134. |
  135. |   Data Stack:                   --
  136. |   String Stack:       filespec$ --
  137. |
  138. |   Kills the specified file.
  139. |
  140.         wait
  141.         endof
  142.       8 of
  143. |
  144. |   MAKEDIR
  145. |
  146. |   Data Stack:                   --
  147. |   String Stack:        dirspec$ --
  148. |
  149. |   Makes the directory specified in dirspec$. If
  150. |   there is an error, the system variable ERROR
  151. |   will be set.
  152. |
  153.         wait
  154.         endof
  155.       9 of
  156. |
  157. |   NEXTFILE
  158. |
  159. |   Data Stack:            --
  160. |   String Stack:          -- file$
  161. |
  162. |   Returns the next file that matches the filespec
  163. |   set by a previous FIRSTFILE command. If there
  164. |   are no more files matching the filespec, the
  165. |   null string ("") is returned.
  166. |
  167.         wait
  168.         endof
  169.      10 of
  170. |
  171. |   REMDIR
  172. |
  173. |   Data Stack:               --
  174. |   String Stack:        dir$ --
  175. |
  176. |   Removes the directory dir$. The directory should
  177. |   be empty before you delete it. If REMDIR fails,
  178. |   the system variable ERROR will be set.
  179. |
  180.         wait
  181.         endof
  182.      11 of
  183. |
  184. |   RENAME
  185. |
  186. |   Data Stack:                            --
  187. |   String Stack:        oldname$ newname$ --
  188. |
  189. |   Renames a file.
  190. |
  191.         wait
  192.         endof
  193.   endcase
  194.  not until
  195.