home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / rpos2101.zip / DOSMENU.P < prev    next >
Text File  |  1998-06-05  |  2KB  |  113 lines

  1. R: dosmenu.p - A simple DOS menu program
  2.  : Written by Rob Linwood (auntfloyd@biosys.net)
  3.  
  4. R: We put this label here so we can jump back to it later
  5. *menu
  6.  
  7. R: Print out the menu
  8. T:      DOS Menu
  9.  : ==================
  10.  : 1. List Files
  11.  : 2. Edit some Files
  12.  : 3. Play Ultima VI
  13.  : 4. Find a file
  14.  : 5. Delete a file
  15.  : 6. Rename a file
  16.  : 7. Copy a file
  17.  : 8. Move a file
  18.  : 9. Quit
  19.  : 
  20.  : What to do? (Enter 1, 2, 3, 4, 5, 6, 7, 8, or 9)
  21.  
  22. R: Get the user's response
  23. A: #what
  24.  
  25. R: Jump to the specified labels
  26.  
  27. J(#what = 1): list
  28. J(#what = 2): edit
  29. J(#what = 3): play
  30. J(#what = 4): find
  31. J(#what = 5): delete
  32. J(#what = 6): rename
  33. J(#what = 7): copy
  34. J(#what = 8): move
  35. J(#what = 9): quit
  36.  
  37. R: If nothing above works, print an error message
  38. T:
  39.  : I don't understand!
  40.  :
  41. J: menu
  42.  
  43. *list
  44. R: First off, list the files
  45. S: dir
  46. R: then return
  47. J: menu
  48.  
  49. *edit
  50. T: Edit which File?
  51. A: $file
  52.  
  53. R: Here we make $command equal to "edit" plus whatever is in $files
  54. C: $command = edit $file
  55.  
  56. T: $command
  57.  
  58. R: Run the newly-constructed command
  59. S: $command
  60. J: menu
  61.  
  62. *play
  63. S: C:\ULTIMA\U6\ULTIMA6
  64. J: menu
  65.  
  66. *find
  67. R: Requires "Whereis" of some sort
  68.  : This is just like what happens in "edit"
  69.  
  70. T: Find which file?
  71. A: $file
  72. C: $command = whereis $file
  73. S: $command
  74. J: menu
  75.  
  76. *delete
  77. T: Delete which file?
  78. A: $file
  79. C: $command = del $file
  80. S: $command
  81. J: menu
  82.  
  83. *rename
  84. T: Rename which file?
  85. A: $file
  86. T: To what?
  87. A: $newname
  88. C: $command = ren $file $newname
  89. S: $command
  90. J: menu
  91.  
  92. *copy
  93. T: Copy which file?
  94. A: $file
  95. T: To where?
  96. A: $newname
  97. C: $command = copy $file $newname
  98. S: $command
  99. J: menu
  100.  
  101. *move
  102. T: Move which file?
  103. A: $file
  104. T: To where?
  105. A: $newname
  106. C: $command = move $file $newname
  107. S: $command
  108. J: menu
  109.  
  110. *quit
  111. E:
  112.  
  113.