home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / BATCH / BCSRCE2.ZIP / UTILMEN2.BC < prev    next >
Encoding:
Text File  |  1990-10-16  |  12.4 KB  |  456 lines

  1. bios
  2. ECHO OFF
  3. break on
  4. rem saving starting drive/directory to return to as needed.
  5. GETDRIVE %!d
  6. GETDIR %!p
  7. rem This is not used in this menu. However, if it was:
  8. rem %!d:
  9. rem cd\%!p
  10. rem would be used each time upon changing drives & directories.
  11. Let %!z = L1
  12. :TOP2
  13. rem This is used only when menu has been overwrittened by some other
  14. rem program or full screen write.
  15. cls
  16. GOSUB MENU
  17. :TOP
  18. rem calling the MAKECOM.BAS created screen .COM file.
  19. GOSUB SCREEN
  20. rem ==============================
  21. rem display a clock on screen
  22. HOUR_HOUR
  23. ERROR_LEVEL %!h
  24. let %!w = %!h
  25. lt %!w 10
  26. if errorlevel 1 let %!h = 0%!h
  27. MINUTE_MINUTE
  28. ERROR_LEVEL %!m
  29. let %!w = %!m
  30. lt %!w 10
  31. if errorlevel 1 let %!m = 0%!m
  32. rem the below feature does not give an accurate reading. 'Tis best
  33. rem to not even use it unless attempting a timing algorythm.
  34. REM SECONDS_SECONDS
  35. REM ERROR_LEVEL %!s
  36. rem locate 2 20
  37. rem echonolf ▐ %!h:%!m:%!s ▌
  38. rem *litebar screen writes
  39. locate 2 21
  40. echonolf ▐ %!h:%!m ▌
  41. rem ==============================
  42. rem Get the key press then evaluate it.
  43. rem Note the sequence of using the same ERRLEVEL test two or three times
  44. rem with its associated action command. For two tests, it means HOME,
  45. rem END, or F1-F9 was pressed. For three tests, either an uppercase
  46. rem or lower case letter was pressed. The third test branches to the
  47. rem chosen menu choice's batch commands.
  48. getkey
  49. IF ERRLEVEL 20224 Let %!z = L9
  50. IF ERRLEVEL 20224 GOTO TOP
  51. IF ERRLEVEL 19712 GOTO RTL1
  52. IF ERRLEVEL 19200 GOTO LTL1
  53. IF ERRLEVEL 18176 Let %!z = L1
  54. IF ERRLEVEL 18176 GOTO TOP
  55. IF ERRLEVEL 17408 Let %!z = L1
  56. IF ERRLEVEL 17408 GOTO TOP
  57. IF ERRLEVEL 17152 Let %!z = L9
  58. IF ERRLEVEL 17152 GOTO TOP
  59. IF ERRLEVEL 16896 Let %!z = L8
  60. IF ERRLEVEL 16896 GOTO TOP
  61. IF ERRLEVEL 16640 Let %!z = L7
  62. IF ERRLEVEL 16640 GOTO TOP
  63. IF ERRLEVEL 16384 Let %!z = L6
  64. IF ERRLEVEL 16384 GOTO TOP
  65. IF ERRLEVEL 16128 Let %!z = L5
  66. IF ERRLEVEL 16128 GOTO TOP
  67. IF ERRLEVEL 15872 Let %!z = L4
  68. IF ERRLEVEL 15872 GOTO TOP
  69. IF ERRLEVEL 15616 Let %!z = L3
  70. IF ERRLEVEL 15616 GOTO TOP
  71. IF ERRLEVEL 15360 Let %!z = L2
  72. IF ERRLEVEL 15360 GOTO TOP
  73. IF ERRLEVEL 15104 Let %!z = L1
  74. IF ERRLEVEL 15104 GOTO TOP
  75. IF ERRLEVEL 119 Let %!z = L3
  76. IF ERRLEVEL 119 GOSUB SCREEN
  77. IF ERRLEVEL 119 GOTO L3
  78. IF ERRLEVEL 118 Let %!z = L6
  79. IF ERRLEVEL 118 GOSUB SCREEN
  80. IF ERRLEVEL 118 GOTO L6
  81. IF ERRLEVEL 117 Let %!z = L2
  82. IF ERRLEVEL 117 GOSUB SCREEN
  83. IF ERRLEVEL 117 GOTO L2
  84. IF ERRLEVEL 114 Let %!z = L9
  85. IF ERRLEVEL 114 GOSUB SCREEN
  86. IF ERRLEVEL 114 GOTO L9
  87. IF ERRLEVEL 105 Let %!z = L8
  88. IF ERRLEVEL 105 GOSUB SCREEN
  89. IF ERRLEVEL 105 GOTO L8
  90. IF ERRLEVEL 102 Let %!z = L7
  91. IF ERRLEVEL 102 GOSUB SCREEN
  92. IF ERRLEVEL 102 GOTO L7
  93. IF ERRLEVEL 100 Let %!z = L5
  94. IF ERRLEVEL 100 GOSUB SCREEN
  95. IF ERRLEVEL 100 GOTO L5
  96. IF ERRLEVEL 99 Let %!z = L4
  97. IF ERRLEVEL 99 GOSUB SCREEN
  98. IF ERRLEVEL 99 GOTO L4
  99. IF ERRLEVEL 97 Let %!z = L1
  100. IF ERRLEVEL 97 GOSUB SCREEN
  101. IF ERRLEVEL 97 GOTO L1
  102. IF ERRLEVEL 87 Let %!z = L3
  103. IF ERRLEVEL 87 GOSUB SCREEN
  104. IF ERRLEVEL 87 GOTO L3
  105. IF ERRLEVEL 86 Let %!z = L6
  106. IF ERRLEVEL 86 GOSUB SCREEN
  107. IF ERRLEVEL 86 GOTO L6
  108. IF ERRLEVEL 85 Let %!z = L2
  109. IF ERRLEVEL 85 GOSUB SCREEN
  110. IF ERRLEVEL 85 GOTO L2
  111. IF ERRLEVEL 82 Let %!z = L9
  112. IF ERRLEVEL 82 GOSUB SCREEN
  113. IF ERRLEVEL 82 GOTO L9
  114. IF ERRLEVEL 73 Let %!z = L8
  115. IF ERRLEVEL 73 GOSUB SCREEN
  116. IF ERRLEVEL 73 GOTO L8
  117. IF ERRLEVEL 70 Let %!z = L7
  118. IF ERRLEVEL 70 GOSUB SCREEN
  119. IF ERRLEVEL 70 GOTO L7
  120. IF ERRLEVEL 68 Let %!z = L5
  121. IF ERRLEVEL 68 GOSUB SCREEN
  122. IF ERRLEVEL 68 GOTO L5
  123. IF ERRLEVEL 67 Let %!z = L4
  124. IF ERRLEVEL 67 GOSUB SCREEN
  125. IF ERRLEVEL 67 GOTO L4
  126. IF ERRLEVEL 65 Let %!z = L1
  127. IF ERRLEVEL 65 GOSUB SCREEN
  128. IF ERRLEVEL 65 GOTO L1
  129. IF ERRLEVEL 27 GOTO END
  130. IF ERRLEVEL 13 GOTO SELECT
  131. GOTO TOP
  132. :SCREEN
  133. rem The structure of this section is:
  134. rem 1) Place cursor at each menu choice's title in turn.
  135. rem 2) If this is the one the user pointed to, hilite it.
  136. rem 3) Otherwise, overwrite it with no hilite.
  137. rem 4) Place cursor at position for a title's descriptive text line.
  138. rem 5) If its menu choice title is hilited, then show the descriptive
  139. rem    text. If not, do nothing.
  140. rem When recycling this code for a new program, this section takes
  141. rem the most rewriting.
  142. locate 4 2
  143. IF %!z = L1 ECHONOLF ▐ADDRBOOK▌
  144. IF NOT %!z = L1 ECHONOLF  ADDRBOOK\\32
  145. locate 6 3
  146. IF %!z = L1 ECHONOLF ADDRess BOOK of Street Talk names (for E-Mail & personal information)      ·
  147. locate 4 12
  148. IF %!z = L2 ECHONOLF ▐Users▌
  149. IF NOT %!z = L2 ECHONOLF  Users\\32
  150. locate 6 3
  151. IF %!z = L2 ECHONOLF Users currently logged onto the VINES network                              ·
  152. locate 4 19
  153. IF %!z = L3 ECHONOLF ▐WHOAMI▌
  154. IF NOT %!z = L3 ECHONOLF  WHOAMI\\32
  155. locate 6 3
  156. IF %!z = L3 ECHONOLF What is my Street Talk name/What server am I logged onto?                  ·
  157. locate 4 27
  158. IF %!z = L4 ECHONOLF ▐COPYD▌
  159. IF NOT %!z = L4 ECHONOLF  COPYD\\32
  160. locate 6 3
  161. IF %!z = L4 ECHONOLF Copy source filespec to target filespec with safeguard builtin             ·
  162. locate 4 34
  163. IF %!z = L5 ECHONOLF ▐DIR_List▌
  164. IF NOT %!z = L5 ECHONOLF  DIR_List\\32
  165. locate 6 3
  166. IF %!z = L5 ECHONOLF Input a Filespec to receive information on those files (ex: C:\123\*.WK?)  ·
  167. locate 4 44
  168. IF %!z = L6 ECHONOLF ▐ViewASCII▌
  169. IF NOT %!z = L6 ECHONOLF  ViewASCII\\32
  170. locate 6 3
  171. IF %!z = L6 ECHONOLF ASCII Chart of Extended IBM characters 128-thru-255 (can be printed)       ·
  172. locate 4 55
  173. IF %!z = L7 ECHONOLF ▐Format_A▌
  174. IF NOT %!z = L7 ECHONOLF  Format_A\\32
  175. locate 6 3
  176. IF %!z = L7 ECHONOLF Format either a 360K or 1.2MB diskette in drive A:                         ·
  177. locate 4 65
  178. IF %!z = L8 ECHONOLF ▐Ignor▌
  179. IF NOT %!z = L8 ECHONOLF  Ignor\\32
  180. locate 6 3
  181. IF %!z = L8 ECHONOLF Reserved for later expansion as needed                                     ·
  182. locate 4 72
  183. IF %!z = L9 ECHONOLF ▐RunDOS▌
  184. IF NOT %!z = L9 ECHONOLF  RunDOS\\32
  185. locate 6 3
  186. IF %!z = L9 ECHONOLF Run a single DOS command without exiting menu program                      ·
  187. RETURN
  188. :SELECT
  189. rem enter was pressed or one of the first letters of each choice
  190. rem This could be rewrittened as GOTO %!z, but it would be less
  191. rem readable.
  192. IF %!z = L1 GOTO L1
  193. IF %!z = L2 GOTO L2
  194. IF %!z = L3 GOTO L3
  195. IF %!z = L4 GOTO L4
  196. IF %!z = L5 GOTO L5
  197. IF %!z = L6 GOTO L6
  198. IF %!z = L7 GOTO L7
  199. IF %!z = L8 GOTO L8
  200. IF %!z = L9 GOTO L9
  201. GOTO TOP
  202. rem left cursor was pressed, positioning is determined
  203. :LTL1
  204. IF NOT %!z = L1 GOTO LTL2
  205. Let %!z = L9
  206. GOTO TOP
  207. :LTL2
  208. IF NOT %!z = L2 GOTO LTL3
  209. Let %!z = L1
  210. GOTO TOP
  211. :LTL3
  212. IF NOT %!z = L3 GOTO LTL4
  213. Let %!z = L2
  214. GOTO TOP
  215. :LTL4
  216. IF NOT %!z = L4 GOTO LTL5
  217. Let %!z = L3
  218. GOTO TOP
  219. :LTL5
  220. IF NOT %!z = L5 GOTO LTL6
  221. Let %!z = L4
  222. GOTO TOP
  223. :LTL6
  224. IF NOT %!z = L6 GOTO LTL7
  225. Let %!z = L5
  226. GOTO TOP
  227. :LTL7
  228. IF NOT %!z = L7 GOTO LTL8
  229. Let %!z = L6
  230. GOTO TOP
  231. :LTL8
  232. IF NOT %!z = L8 GOTO LTL9
  233. Let %!z = L7
  234. GOTO TOP
  235. :LTL9
  236. IF NOT %!z = L9 GOTO LTL1
  237. Let %!z = L8
  238. GOTO TOP
  239. rem right cursor was pressed, positioning is determined
  240. :RTL1
  241. IF NOT %!z = L1 GOTO RTL2
  242. Let %!z = L2
  243. GOTO TOP
  244. :RTL2
  245. IF NOT %!z = L2 GOTO RTL3
  246. Let %!z = L3
  247. GOTO TOP
  248. :RTL3
  249. IF NOT %!z = L3 GOTO RTL4
  250. Let %!z = L4
  251. GOTO TOP
  252. :RTL4
  253. IF NOT %!z = L4 GOTO RTL5
  254. Let %!z = L5
  255. GOTO TOP
  256. :RTL5
  257. IF NOT %!z = L5 GOTO RTL6
  258. Let %!z = L6
  259. GOTO TOP
  260. :RTL6
  261. IF NOT %!z = L6 GOTO RTL7
  262. Let %!z = L7
  263. GOTO TOP
  264. :RTL7
  265. IF NOT %!z = L7 GOTO RTL8
  266. Let %!z = L8
  267. GOTO TOP
  268. :RTL8
  269. IF NOT %!z = L8 GOTO RTL9
  270. Let %!z = L9
  271. GOTO TOP
  272. :RTL9
  273. IF NOT %!z = L9 GOTO RTL1
  274. Let %!z = L1
  275. GOTO TOP
  276. rem L1-L9 are the commands associated with each menu choice.
  277. rem Suggested continuations are L10-L##. You can choose where to
  278. rem restart the hilited choice from when taken back to the menu
  279. rem by changing the value of %!z variable.
  280. :L1
  281. addrbook
  282. Let %!z = L1
  283. goto TOP2
  284. :L2
  285. cls
  286. echo/
  287. echo/
  288. echo/
  289. users
  290. echo/
  291. echo/
  292. echo.
  293. gosub KLUDGWAT
  294. Let %!z = L2
  295. goto TOP2
  296. :L3
  297. CLS
  298. WHOAMI
  299. ECHO.
  300. ECHO.
  301. WHATZ
  302. echo.
  303. echo.
  304. echo.
  305. gosub KLUDGWAT
  306. Let %!z = L3
  307. goto TOP2
  308. :L4
  309. !COPYD
  310. Let %!z = L4
  311. goto TOP2
  312. :L5
  313. cls
  314. gosub BASICS
  315. rem fits within the info block of BASICS subroutines screen mask.
  316. locate 8 4
  317. echonolf  █  Waiting  █
  318. locate 9 4
  319. echonolf  █  for      █
  320. locate 10 4
  321. echonolf  █  Input!   █
  322. locate 15 1
  323. let %!z = *.*
  324. echonolf Input a valid filespec (ex: *.DOC):\\32
  325. read %!z
  326. dir %!z /p
  327. echo.
  328. gosub KLUDGWAT
  329. Let %!z = L5
  330. goto TOP2
  331. :L6
  332. rem Taken from Wenham's included program. Minor modifications.
  333. cls
  334. :start
  335. let %!z = 128
  336. :loop
  337. rem Calculate the line number to display the character on.
  338. let %!y = %!z
  339. sub %!y 128
  340. div %!y 8
  341. add %!y 1
  342. rem Calculate the column number to display the character on.
  343. let %!x = %!z
  344. sub %!x 128
  345. mod %!x 8
  346. mul %!x 10
  347. add %!x 1
  348. locate %!y %!x
  349. echonolf %!z = \\%!z
  350. add %!z 1
  351. if not %!z == 256 goto loop
  352. echo.
  353. echo   Note:  These characters can be inputted via most applications by holding
  354. echo          down the 'Alt' key, typing in the appropriate number (number keypad
  355. echo          only), and then releasing Alt.
  356. echo.
  357. echo        Examples:   Alt + 219 = █,  Alt + 205 = ═,  Alt + 171 = ½
  358. echo.
  359. gosub KLUDGWAT
  360. Let %!z = L6
  361. goto TOP2
  362. :L7
  363. rem Mini static menu.
  364. cls
  365. echo.
  366. :FORM
  367. locate 8 1
  368. echo Press 1 (360K diskette) or 2 (1.2 MB diskette) or ESC to abort
  369. getkey
  370. IF ERRLEVEL 50 Let %!z = A:
  371. IF ERRLEVEL 50 GOTO FORM2
  372. IF ERRLEVEL 49 Let %!z = A: /4
  373. IF ERRLEVEL 49 GOTO FORM2
  374. IF ERRLEVEL 27 Let %!z = L1
  375. IF ERRLEVEL 27 goto TOP2
  376. goto FORM
  377. :FORM2
  378. CLS
  379. locate 8 1
  380. if ERRLEVEL 50 ECHO              ▄▄▄▄▄█ Format will be for 1.2 Megabytes █▄▄▄▄▄
  381. if ERRLEVEL 49 ECHO              ▄▄▄▄▄█ Format will be for 360 Kilobytes █▄▄▄▄▄
  382. echo.
  383. echo.
  384. ECHO         Hold Down CTRL and Press C to abort formatting Drive A:
  385. echo.
  386. rem We have two people using PC Tools 6.0. This test will take that into
  387. rem account. Five of our PC's have the DOS utilities stored in C:\DOS.
  388. rem The rest have it in C:\UTIL directory (local drive).
  389. IF EXIST C:\UTIL\FORMAT!.COM PCFORMAT %!z
  390. IF EXIST C:\UTIL\FORMAT.COM FORMAT %!z
  391. IF EXIST C:\DOS\FORMAT.COM FORMAT %!z
  392. Let %!z = L1
  393. goto TOP2
  394. :L8
  395. rem This was left for expansion.
  396. Let %!z = L1
  397. goto TOP2
  398. :L9 DOS
  399. cls
  400. gosub BASICS
  401. rem fits within the info block of BASICS subroutines screen mask.
  402. locate 8 4
  403. echonolf  █  Waiting  █
  404. locate 9 4
  405. echonolf  █  for      █
  406. locate 10 4
  407. echonolf  █  Input!   █
  408. locate 15 1
  409. Let %!z = dir
  410. echonolf Input a DOS command:\\32
  411. read %!z
  412. command /c %!z
  413. gosub KLUDGWAT
  414. Let %!z = L9
  415. goto TOP2
  416. :KLUDGWAT
  417. rem BATCOM has a problem with the WAITKEY command. Regardless of the key pressed,
  418. rem it is passed on. CLEARBUF, or even a subsequent KEYBUF/WAITKEY or WAIT won't
  419. rem counteract this. If the SECONDS_SECONDS worked properly, that could be
  420. rem used as a workaround. So, I guess this is the best method for now. That
  421. rem is to state that the key press is passed on.
  422. echo               Wait 60 seconds or press spacebar to return to menu.
  423. echo                 Pressing any letter branches to that menu choice.
  424. waitkey 59
  425. return
  426. :MENU
  427. rem This was a text file of 24 rows by 80 columns that was converted
  428. rem into a executing screen .COM file with PC Magazine's MAKECOM.BAS
  429. rem program. This is included with DOS Power Tools, Bantam, 50 bucks.
  430. utilmask
  431. return
  432. :BASICS
  433. rem Generic screen routine that I use whenever asking the user to input
  434. rem a filespec. The empty box is for flashing messages.
  435. echonolf ╔══════════════════════════════════════════════════════════════════════════════╗
  436. echonolf ║                                  DOS BASICS                                  ║
  437. echonolf ║                                                                              ║
  438. echonolf ║ Suggested Filenaming:  A-Z, underscore, 0-9, begin with letter avoid dash(-) ║
  439. echonolf ║ Wildcards:  Filenams.Ext = File????.Ex? = Fil*.E?t = F*.* = ????N*.??t = *.* ║
  440. echonolf ║ Directory Anatomy:  C:\DIR\SUBDIR\SUBDIR2\Filespec.Ext                       ║
  441. echonolf ║ ╔════════════════╗  │  │   ├──────┘       └─Name of file(s) and Extension    ║
  442. echonolf ║ ║                ║  │  │   └─Subdirectories with required "\" divider        ║
  443. echonolf ║ ║                ║  │  └─1st Level directory preceded with required ":\"     ║
  444. echonolf ║ ║                ║  └─Drive identifier A-E unless Network loaded then A-Z    ║
  445. echonolf ╚═╩════════════════╩═══════════════════════════════════════════════════════════╝
  446. return
  447. :END
  448. rem ready to quit program.
  449. cls
  450. beep
  451. echo     ╔═════════════════════════════════════════════════════════════════════╗
  452. echo     ║ Type:     UTILMENU        ««« ««« ««« ««« {to reenter menu program} ║
  453. echo     ╚═════════════════════════════════════════════════════════════════════╝
  454. exit
  455.  
  456.