home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / asic / manage / util1-80.asi < prev    next >
Encoding:
Text File  |  1993-05-01  |  26.3 KB  |  1,511 lines

  1. rem UTIL1-80.COM
  2.  
  3. rem consecutive to wait2:
  4.  
  5. b$=chr$(27)
  6. c$=chr$(13)
  7. d$=chr$(8)
  8. e$=chr$(32)
  9.  
  10. a$=command$
  11. if a$="/a" then asciilis:
  12. if a$="/c" then changedi:
  13. if a$="/cr" then calculat:
  14. if a$="/h" then help:
  15. if a$="/i" then install:
  16. if a$="/v" then readfile:
  17. if a$="/l" then printfil:
  18. if a$="/co" then copyfile:
  19. if a$="/s" then seefiles:
  20. if a$="/S" then seefiles:
  21. if a$="/s 40" then seefil40:
  22. if a$="/S 40" then seefil40:
  23. if a$="/m" then movefile:
  24.  
  25. rem Here is the routine for generating an ASCII list.
  26.  
  27. asciilis:
  28. cls
  29. print "Here are your options:"
  30. print
  31. print
  32. print "F1- Print the entire list."
  33. print
  34. print "F2- Print one code of your choice."
  35. print
  36. print "Esc- Quit and return to the Main Options Menu."
  37. print
  38. print
  39. print "Please press the key corresponding to your choice. ";
  40.  
  41. wait:
  42. gosub continue:
  43.  
  44. if a$=b$ then
  45. end
  46. endif
  47.  
  48. if extended=0 then wait:
  49. if a$=";" then printlis:
  50. if a$="<" then printone:
  51. goto wait:
  52.  
  53. printlis:
  54. cls
  55. for c=0 to 255
  56. print c;
  57. print " - ";
  58. a$=chr$(c)
  59.  
  60. if c=0 then
  61. a$=" "
  62. endif
  63.  
  64. print a$;
  65. print " ";
  66. column=column+1
  67.  
  68. if column=6 then
  69. print
  70. column=0
  71. row=row+1
  72. endif
  73.  
  74. if row=20 then
  75. print
  76. print
  77. print "Press any key to continue. ";
  78. gosub continue:
  79. row=0
  80. cls
  81. endif
  82.  
  83. next c
  84.  
  85. print
  86. print
  87. print
  88. print "Press any key to return to the Main Options Menu. ";
  89. gosub continue:
  90. end
  91.  
  92. printone:
  93. cls
  94. print "Please type the code number of the character you want to view, from 0"
  95. print "to 255. ";
  96. gosub retypefi:
  97. d=val(file$)
  98. file$=""
  99. if a<0 then printone:
  100. if a>255 then printone:
  101. onecode$=chr$(d)
  102. width 40
  103. locate 12,20
  104. print onecode$
  105. print
  106. print
  107. print
  108. print "Press any key to return to the Main"
  109. print "Options Menu. ";
  110. gosub continue:
  111. width 80
  112. end
  113.  
  114. rem This is the end of the routine for generating an ASCII list.
  115.  
  116.  
  117. rem Here is the routine for the Crapulator (Crappy Calculator)
  118. calculat:
  119. cls
  120. print "                          Welcome to the Crapulator!"
  121. print
  122. print
  123. print "You can add, subtract, or multiply two numbers.  You can use the"
  124. print "numeric keypad if you like; Num Lock has been turned on for you."
  125. print
  126. print
  127. print "Press any key to continue. ";
  128. gosub continue:
  129. call "numlockn.exe",""
  130. spaces$=space$(68)
  131. print spaces$;
  132. color 0,7
  133. print "Esc=Quit"
  134. color 7,0
  135. print
  136. print "Please enter your math problem. ";
  137. gosub calcmore:
  138.  
  139. if operator$>"" then
  140. print operator$;
  141. calc1=val(calc$)
  142. goto checkcal:
  143. endif
  144.  
  145. checkcal:
  146. if a$=c$ then
  147. calc2=val(calc$)
  148. goto docalc:
  149. else
  150. calc$=""
  151. gosub calcmore:
  152. goto checkcal:
  153. endif
  154.  
  155. docalc:
  156. if operator$="+" then
  157. result=calc1+calc2
  158. print "=";
  159. print result
  160. print
  161. print "Press any key to return to the Main Options Menu. ";
  162. gosub continue:
  163. call "numlockf.exe",""
  164. calc$=""
  165. operator$=""
  166. calc1=0
  167. calc2=0
  168. result=0
  169. end
  170. endif
  171.  
  172. if operator$="-" then
  173. result=calc1-calc2
  174. print "=";
  175. print result
  176. print
  177. print "Press any key to return to the Main Options Menu. ";
  178. gosub continue:
  179. call "numlockf.exe",""
  180. calc$=""
  181. operator$=""
  182. calc1=0
  183. calc2=0
  184. result=0
  185. end
  186. endif
  187.  
  188. if operator$="*" then
  189. result=calc1*calc2
  190. print "=";
  191. print result
  192. print
  193. print "Press any key to return to the Main Options Menu. ";
  194. gosub continue:
  195. call "numlockf.exe",""
  196. calc$=""
  197. operator$=""
  198. calc1=0
  199. calc2=0
  200. result=0
  201. end
  202. endif
  203.  
  204. calcmore:
  205. gosub continue:
  206.  
  207. if a$=b$ then
  208. operator$=""
  209. calc$=""
  210. calc1=0
  211. calc2=0
  212. result=0
  213. call "numlockf.exe",""
  214. end
  215. endif
  216.  
  217. if a$="+" then
  218. operator$="+"
  219. return
  220. endif
  221.  
  222. if a$="-" then
  223. operator$="-"
  224. return
  225. endif
  226.  
  227. if a$="*" then
  228. operator$="*"
  229. return
  230. endif
  231.  
  232. if a$=c$ then
  233. return
  234. endif
  235.  
  236. gosub cursor:
  237.  
  238. if a$=d$ then
  239. locate a,c
  240. print e$;
  241. locate a,c
  242. d=len(calc$)
  243. e=d-1
  244. calc$=mid$(calc$,1,e)
  245. if e<0 then
  246. e=0
  247. c=c+1
  248. locate a,c
  249. endif
  250. if b=0 then
  251. a=a-1
  252. b=79
  253. locate a,b
  254. print e$;
  255. locate a,b
  256. endif
  257. goto calcmore:
  258. endif
  259.  
  260. print a$;
  261. calc$=calc$+a$
  262. goto calcmore:
  263.  
  264. rem THIS IS THE END OF THE ROUTINE FOR THE CRAPULATOR (CRAPPY CALCULATOR).
  265.  
  266.  
  267. rem Here is the routine for changing the default directory.
  268.  
  269. changedi:
  270. cls
  271. spaces$=space$(68)
  272. print spaces$;
  273. color 0,7
  274. print "Esc=Quit"
  275. color 7,0
  276. print
  277. print
  278. print "                               Change Directory"
  279. print
  280. print
  281. print "This option will change the default directory where The Manager will"
  282. print "look for files if you don't specify the path.  It's also the directory"
  283. print "you'll be in when you return to DOS, unless you come back here and"
  284. print "change to your previous directory before exiting.  At this time, there"
  285. print "is no way to change the default drive."
  286. print
  287. print
  288. print "Directory to change to? ";
  289. gosub retypefi:
  290. directory$=file$
  291. file$=""
  292. rechange:
  293. chdir directory$
  294. if error=3 then nopathch:
  295. realdir$=ucase$(directory$)
  296. print ""
  297. print ""
  298. print "Your new default directory is ";
  299. print realdir$;
  300. print "."
  301. print ""
  302. print ""
  303. print "Press any key to return to the Main Options Menu. ";
  304. gosub continue:
  305. end
  306.  
  307. rem This is the end of the routine for changing the default directory.
  308.  
  309.  
  310. rem Here is the routine for typing in filenames in 80-column mode.
  311.  
  312. retypefi:
  313. gosub continue:
  314.  
  315. if a$=b$ then
  316. file$=""
  317. file1$=""
  318. file2$=""
  319. end
  320. endif
  321.  
  322. if a$=c$ then
  323. print ""
  324. return
  325. endif
  326.  
  327. gosub cursor:
  328.  
  329. if a$=d$ then
  330. locate a,c
  331. print e$;
  332. locate a,c
  333. d=len(file$)
  334. e=d-1
  335. file$=mid$(file$,1,e)
  336. if e<0 then
  337. e=0
  338. c=c+1
  339. locate a,c
  340. endif
  341. if b=0 then
  342. a=a-1
  343. b=79
  344. locate a,b
  345. print e$;
  346. locate a,b
  347. endif
  348. goto retypefi:
  349. endif
  350.  
  351. print a$;
  352. file$=file$+a$
  353. realfile$=ucase$(file$)
  354. goto retypefi:
  355.  
  356. rem This is the end of the routine for typing in files in 80-column mode.
  357.  
  358.  
  359. rem Here is the help screen routine.
  360.  
  361. help:
  362. cls
  363. print "You can use arguments with The Manager if you wish; they may help"
  364. print "save you time."
  365. print
  366. print
  367. print "Just typing MANAGER at the DOS prompt will start The Manager from" 
  368. print "the beginning; you can choose your options from the menu."
  369. print
  370. print "Typing MANAGER /? gives you this help screen."
  371. print
  372. print "Typing MANAGER /d moves you directly to the Delete Files option."
  373. print
  374. print "Typing MANAGER /m moves you directly to the Make Directory option."
  375. print
  376. print "Typing MANAGER /n moves you directly to the Rename Files option."
  377. print
  378. print "Typing MANAGER /g moves you directly to the Get Date option."
  379. print
  380. print "Typing MANAGER /b blanks your screen."
  381. print
  382. print "Typing MANAGER /p checks for a graphics adaptor."
  383. print
  384. print
  385. print "Press any key to continue. ";
  386. gosub continue:
  387. cls
  388. print "Typing MANAGER /s lets you see a list of disk files."
  389. print
  390. print "Typing MANAGER /v lets you view the text file of your choice, on the"
  391. print "screen."
  392. print
  393. print "Typing MANAGER /l lets you print a file on the lineprinter."
  394. print
  395. print "Typing MANAGER /r lets you run other programs."
  396. print
  397. print "Typing MANAGER /e lets you remove directories."
  398. print
  399. print "Typing MANAGER /c lets you copy text files."
  400. print
  401. print
  402. print "Upper or lower case makes no difference."
  403. print
  404. print
  405. print "Press any key to return to the main options menu. ";
  406.  
  407. gosub continue:
  408. end
  409.  
  410. rem This is the end of the routine for the list of DOS parameters.
  411.  
  412.  
  413. rem Here is the routine for installing an automatic parameter.
  414.  
  415. install:
  416. cls
  417. print "This option will install an automatic parameter.  When you type"
  418. print "MANAGER without any DOS parameters, it will automatically go to this"
  419. print "option.  For instance, if you want to go directly to the option for"
  420. print "deleting files everytime you run The Manager, you can install that op-"
  421. print "tion here."
  422. print
  423. print
  424. print "Press any key to continue. ";
  425. gosub continue:
  426. cls
  427.  
  428. installm:
  429. print "Here are the options you can install:"
  430. print
  431. print
  432. print "F1- Help Screen.                        <Alt-F1>- Run Other Programs."
  433. print
  434. print "F2- Delete Files.                       <Alt-F2>- Remove Directory."
  435. print
  436. print "F3- Make Directory.                     <Alt-F3>- Copy Text File."
  437. print
  438. print "F4- Rename Files.                       <Alt-F4>- Move Text File."
  439. print
  440. print "F5- Get the Time/Date.                  <Alt-F5>- Use 40-Column Mode."
  441. print
  442. print "F6- Blank the Screen.                   <Alt-F6>- Skip Opening Screen."
  443. print
  444. print "F7- Check for Graphics Card.            <Alt-F7>- De-install Options."
  445. print
  446. print "F8- See File List.                               Esc- Quit."
  447. print
  448. print "F9- Read File."
  449. print
  450. print "F10- Print File."
  451. print
  452. print "Please press the key corresponding to your choice. ";
  453.  
  454. wait1:
  455. gosub continue:
  456.  
  457. if a$=b$ then
  458. end
  459. endif
  460.  
  461. if extended=0 then wait1:
  462. open "o",1,"install.cfg"
  463.  
  464. if a$=";" then
  465. install$="/?"
  466. gosub writeins:
  467. goto writedon:
  468. endif
  469.  
  470. if a$="<" then
  471. install$="/d"
  472. gosub writeins:
  473. goto writedon:
  474. endif
  475.  
  476. if a$="=" then
  477. install$="/m"
  478. gosub writeins:
  479. goto writedon:
  480. endif
  481.  
  482. if a$=">" then
  483. install$="/n"
  484. gosub writeins:
  485. goto writedon:
  486. endif
  487.  
  488. if a$="?" then
  489. install$="/g"
  490. gosub writeins:
  491. goto writedon:
  492. endif
  493.  
  494. if a$="@" then
  495. install$="/b"
  496. gosub writeins:
  497. goto writedon:
  498. endif
  499.  
  500. if a$="A" then
  501. install$="/p"
  502. gosub writeins:
  503. goto writedon:
  504. endif
  505.  
  506. if a$="B" then
  507. install$="/s"
  508. gosub writeins:
  509. goto writedon:
  510. endif
  511.  
  512. if a$="C" then
  513. install$="/v"
  514. gosub writeins:
  515. goto writedon:
  516. endif
  517.  
  518. if a$="D" then
  519. install$="/l"
  520. gosub writeins:
  521. goto writedon:
  522. endif
  523.  
  524. if a$="h" then
  525. install$="/r"
  526. gosub writeins:
  527. goto writedon:
  528. endif
  529.  
  530. if a$="i" then
  531. install$="/e"
  532. gosub writeins:
  533. goto writedon:
  534. endif
  535.  
  536. if a$="j" then
  537. install$="/c"
  538. gosub writeins:
  539. goto writedon:
  540. endif
  541.  
  542. if a$="k" then
  543. install$="/o"
  544. gosub writeins:
  545. goto writedon:
  546. endif
  547.  
  548. if a$="l" then
  549. install$="/40"
  550. gosub writeins:
  551. goto writedon:
  552. endif
  553.  
  554. if a$="m" then
  555. install$="bypass"
  556. gosub writeins:
  557. goto writedon:
  558. endif
  559.  
  560. if a$="n" then
  561. install$="nothing"
  562. gosub writeins:
  563. goto writedon:
  564. endif
  565.  
  566. goto wait1:
  567.  
  568. writeins:
  569. print # 1, install$
  570. close 1
  571. return
  572.  
  573. writedon:
  574. cls
  575. print "The option you have chosen will now be run every time you load The"
  576. print "Manager without parameters.  To choose another option, or deinstall"
  577. print "all options, return to the install menu and press the appropriate key."
  578. print
  579. print
  580. print "Press any key to return to the Main Options Menu. ";
  581. gosub continue:
  582. end
  583.  
  584. rem THIS IS THE END OF THE ROUTINE FOR INSTALLING A DOS PARAMETER.
  585.  
  586.  
  587. rem HERE IS THE ROUTINE FOR READING A FILE.
  588.  
  589. readfile:
  590. cls
  591. print "                                  Read a File"
  592. print
  593. print
  594.  
  595. rem For a nice touch, we add an Esc=Quit message.  First, since I wanted it in
  596. rem the upper right hand corner, I added spaces.
  597.  
  598. spaces$=space$(68)
  599. print spaces$;
  600.  
  601. rem Next, I reversed the color, so it wouldn't get lost.  I change my mind a 
  602. rem lot when using software and, assuming I'm not the only one, I thought it'd 
  603. rem be nice to make the "change your mind" option as obvious as possible.
  604.  
  605. color 0,7
  606. print "Esc=Quit"
  607. color 7,0
  608. print "Please type the name of the file you want to read."
  609. print "Include drive and path. ";
  610. gosub retypefi:
  611. print ""
  612. print ""
  613. print "To pause the scrolling, press the space bar.  To quit, press Esc."
  614. print
  615. print
  616. print "While the file should be readable, formatting may not be quite"
  617. print "correct."
  618. print
  619. print
  620. print "Press any key to continue. ";
  621. gosub continue:
  622. a$=""
  623.  
  624. cls
  625.  
  626. reread:
  627. open "i",1,file$
  628.  
  629. if error=2 then
  630. gosub nofilerd:
  631. goto reread:
  632. endif
  633.  
  634. if error=3 then nopathrd:
  635.  
  636. readmore:
  637. input# 1, line$ crlf
  638.  
  639. if error=96 then
  640. print line$
  641. line=line+1
  642. if line=23 then
  643. print "Press any key to continue. ";
  644. gosub continue:
  645. print
  646. print
  647. line=0
  648. cls
  649. endif
  650. gosub blanklnr:
  651. endif
  652.  
  653. line=line+1
  654.  
  655. if line=23 then
  656. print ""
  657. print "Press any key to continue. ";
  658. gosub continue:
  659. print
  660. print
  661.  
  662. if a$=b$ then
  663. line=0
  664. file$=""
  665. close 1
  666. print
  667. print
  668. print "Do you want to view another file? (y/n) ";
  669. goto wait56:
  670. endif
  671.  
  672. line=0
  673. cls
  674. endif
  675.  
  676. print line$
  677.  
  678. a$=inkey$
  679. if a$=e$ then
  680. print "Press any key to continue. ";
  681. gosub continue:
  682. print
  683. print
  684. endif
  685.  
  686. if a$=b$ then
  687. file$=""
  688. line=0
  689. close 1
  690. print
  691. print
  692. print "Do you want to view another file? (y/n) ";
  693. goto wait56:
  694. endif
  695.  
  696. if error=99 then eof:
  697. goto readmore:
  698.  
  699. blanklnr:
  700. input# 1, line$ crlf
  701. if line$="" then readmore:
  702. return
  703.  
  704. eof:
  705. print line$
  706. print "Press any key to continue. ";
  707. gosub continue:
  708. print
  709. print
  710. line=0
  711. file$=""
  712. close 1
  713. print
  714. print
  715. print "Do you want to view another file? (y/n) ";
  716.  
  717. wait56:
  718. gosub continue:
  719. if a$="y" then readfile:
  720. if a$="Y" then readfile:
  721.  
  722. if a$="n" then
  723. end
  724. endif
  725.  
  726. if a$="N" then
  727. end
  728. endif
  729.  
  730. goto wait56:
  731.  
  732. rem THIS IS THE END OF THE ROUTINE FOR READING TEXT FILES.
  733.  
  734.  
  735. rem HERE IS THE ROUTINE FOR PRINTING TEXT FILES.
  736.  
  737. printfil:
  738.  
  739. cls
  740. print "                                 Print a File"
  741. print
  742. print
  743. spaces$=space$(68)
  744. print spaces$;
  745. color 0,7
  746. print "Esc=Quit"
  747. color 7,0
  748. print "Please type the name of the file you want to print."
  749. print
  750. print "Include the drive and path. ";
  751. gosub retypefi:
  752.  
  753. doprintf:
  754. f$=chr$(12)
  755. open "i",1,file$
  756.  
  757. if error=2 then
  758. gosub nofilerd:
  759. goto doprintf:
  760. endif
  761.  
  762. if error=3 then nopathpr:
  763.  
  764. heading:
  765. cls
  766. print "Printing...";
  767. realfile$=ucase$(file$)
  768. color 0,7
  769. print realfile$
  770. color 7,0
  771. print
  772. print
  773. print "Press space bar to pause printing, or Esc to quit."
  774. print
  775. print
  776.  
  777. printmor:
  778. input# 1, line$ crlf
  779.  
  780. if error=96 then
  781. lprint line$
  782. goto blanklin:
  783. endif
  784.  
  785. contlprn:
  786. lprint line$
  787.  
  788. a$=inkey$
  789.  
  790. if a$=b$ then
  791. print "Printing has been terminated.  The printer may still have data in its"
  792. print "buffer.  If so, it will continue printing until the buffer is empty."
  793. lprint f$
  794. close 1
  795. file$=""
  796. print
  797. print
  798. print "Print another file? (y/n) ";
  799. goto wait13:
  800. endif
  801.  
  802. if a$=e$ then
  803. print "Press any key to resume printing. ";
  804. gosub continue:
  805. endif
  806.  
  807. if error=99 then eofp:
  808. goto printmor:
  809.  
  810. blanklin:
  811. input# 1, line$ crlf
  812. if line$="" then printmor: else contlprn:
  813.  
  814. eofp:
  815. lprint line$
  816. print "Finished."
  817. close 1
  818. lprint f$
  819. file$=""
  820. print
  821. print
  822. print "Print another file? (y/n) ";
  823.  
  824. wait13:
  825. gosub continue:
  826. if a$="y" then printfil:
  827. if a$="Y" then printfil:
  828.  
  829. if a$="n" then
  830. end
  831. endif
  832.  
  833. if a$="N" then
  834. end
  835. endif
  836. goto wait13:
  837.  
  838.  
  839. rem THIS IS THE END OF THE ROUTINE FOR PRINTING TEXT FILES.
  840.  
  841.  
  842. rem HERE IS THE ROUTINE FOR COPYING TEXT FILES.
  843.  
  844. copyfile:
  845. cls
  846. print "                                   Copy File"
  847. print
  848. print
  849. print "*****PLEASE NOTE***** Only text files will copy properly using this"
  850. print "method.  Files with an extension of .EXE, .COM, or which contain other"
  851. print "special characters will usually not copy properly."
  852. print
  853. print "Press any key to continue. ";
  854. gosub continue:
  855.  
  856. copymore:
  857. cls
  858. spaces$=space$(68)
  859. print spaces$;
  860. color 0,7
  861. print "Esc=Quit"
  862. color 7,0
  863. print
  864. print "File to copy (include drive and path)? ";
  865. gosub retypefi:
  866. file1$=file$
  867. file$=""
  868. realfil1$=ucase$(file1$)
  869.  
  870. print ""
  871. print "Destination (include drive and path)? ";
  872. gosub retypefi:
  873. file2$=file$
  874. realfil2$=ucase$(file2$)
  875. reinput:
  876. open "i",1,file1$
  877. if error=2 then nofilecf:
  878.  
  879. if error=3 then
  880. labelnum=1
  881. goto nopathcf:
  882. endif
  883.  
  884. open "o",2,file2$
  885. reoutput:
  886.  
  887. if error=3 then
  888. labelnum=2
  889. goto nopathcf:
  890. endif
  891.  
  892. if error=5 then cantopen:
  893.  
  894. wait3:
  895. input # 1, line$ crlf
  896. if error=99 then copydone:
  897.  
  898. if error=96 then
  899. print # 2, line$ nonull
  900. input # 1, line$ crlf
  901. if line$="" then
  902. print # 2, crlf$ nonull
  903. goto wait3:
  904. endif
  905. endif
  906.  
  907. print # 2, line$ nonull
  908. print # 2, crlf$ nonull
  909. goto wait3:
  910.  
  911. copydone:
  912. close 1
  913. close 2
  914. print ""
  915. print ""
  916. print realfil1$;
  917. print " has been copied to ";
  918. print realfil2$;
  919. print "."
  920. print
  921. print "Copy another? ";
  922.  
  923. a$=""
  924. while a$=""
  925. gosub continue:
  926. if a$="y" then copymore:
  927. if a$="Y" then copymore:
  928.  
  929. if a$="n" then
  930. end
  931. endif
  932.  
  933. if a$="N" then
  934. end
  935. endif
  936. wend
  937.  
  938. rem THIS IS THE END OF THE ROUTINE FOR COPYING A TEXT FILE.
  939.  
  940.  
  941. rem Here is the routine for viewing disk files.
  942.  
  943.  
  944. b$=chr$(27)
  945. c$=chr$(13)
  946. d$=chr$(8)
  947. e$=chr$(32)
  948.  
  949.  
  950. seefiles:
  951. cls
  952. print "                                  Find Files"
  953. print
  954. print
  955. spaces$=space$(68)
  956. print spaces$;
  957. color 0,7
  958. print "Esc=Quit"
  959. color 7,0
  960. print "Please type the full path and filename.  You'll need to know which"
  961. print "directory your file is in, but wildcards are acceptable."
  962. print
  963. print "> ";
  964.  
  965. wait2:
  966. gosub continue:
  967.  
  968. if a$=b$ then
  969. directory$=""
  970. goto menu:
  971. endif
  972.  
  973. if a$=c$ then doview:
  974. gosub cursor:
  975.  
  976. if a$=d$ then
  977. locate a,c
  978. print e$;
  979. locate a,c
  980. d=len(directory$)
  981. e=d-1
  982. directory$=mid$(directory$,1,e)
  983. if e<0 then
  984. e=0
  985. c=c+1
  986. locate a,c
  987. endif
  988. if b=0 then
  989. a=a-1
  990. b=79
  991. locate a,b
  992. print e$;
  993. locate a,b
  994. endif
  995. goto wait2:
  996. endif
  997.  
  998. print a$;
  999. directory$=directory$+a$
  1000. goto wait2:
  1001.  
  1002. doview:
  1003. print ""
  1004.  
  1005. files$=directory$
  1006. attrib=&bin00010000
  1007. filename$=find first(files$,attrib)
  1008. if error>0 then done:
  1009. print filename$
  1010.  
  1011. loop:
  1012. filename$=find continue
  1013. if error>0 then done:
  1014.  
  1015. print filename$
  1016.  
  1017. file=file+1
  1018.  
  1019. if file=20 then
  1020. print ""
  1021. print ""
  1022. print "Press any key to continue. ";
  1023. gosub continue:
  1024. file=0
  1025. print
  1026. print
  1027. endif
  1028.  
  1029. goto loop:
  1030.  
  1031. done:
  1032. print ""
  1033. print ""
  1034. print "Press any key to continue. ";
  1035. gosub continue:
  1036. file=0
  1037. directory$=""
  1038. print ""
  1039. print ""
  1040. print "Do you want to see more files? (y/n) ";
  1041.  
  1042. wait55:
  1043. gosub continue:
  1044. if a$="y" then seefiles:
  1045. if a$="Y" then seefiles:
  1046. if a$="n" then menu:
  1047. if a$="N" then menu:
  1048. goto wait55:
  1049.  
  1050.  
  1051. rem Here is the routine for viewing files in 40-column mode.
  1052.  
  1053. seefil40:
  1054. width 40
  1055. print "View Your Files"
  1056. print
  1057. print
  1058. spaces$=space$(30)
  1059. print spaces$;
  1060. color 0,7
  1061. print "Esc=Quit"
  1062. color 7,0
  1063. print "Which directory (include drive and"
  1064. print "path)? ";
  1065.  
  1066. wait54:
  1067. gosub continue:
  1068.  
  1069. if a$=b$ then
  1070. directory$=""
  1071. goto menu:
  1072. endif
  1073.  
  1074. if a$=c$ then doview40:
  1075. gosub cursor:
  1076.  
  1077. if a$=d$ then
  1078. locate a,c
  1079. print e$;
  1080. locate a,c
  1081. d=len(directory$)
  1082. e=d-1
  1083. directory$=mid$(directory$,1,e)
  1084. if e<0 then
  1085. e=0
  1086. c=c+1
  1087. locate a,c
  1088. endif
  1089. if b=0 then
  1090. a=a-1
  1091. b=38
  1092. locate a,b
  1093. print e$;
  1094. locate a,b
  1095. endif
  1096. goto wait54:
  1097. endif
  1098.  
  1099. print a$;
  1100. directory$=directory$+a$
  1101. goto wait54:
  1102.  
  1103. doview40:
  1104. print ""
  1105. files$=directory$
  1106. attrib=&bin00010000
  1107. filename$=find first(files$,attrib)
  1108. if error>0 then done40:
  1109. print filename$
  1110.  
  1111. loop40:
  1112. filename$=find continue
  1113. if error>0 then done40:
  1114. print filename$
  1115.  
  1116. file=file+1
  1117.  
  1118. if file=20 then
  1119. print
  1120. print
  1121. print "Press any key to continue. ";
  1122. gosub continue:
  1123. file=0
  1124. print
  1125. print
  1126. endif
  1127.  
  1128. goto loop40:
  1129.  
  1130. done40:
  1131. print
  1132. print
  1133. print "Press any key to continue. ";
  1134. gosub continue:
  1135. file=0
  1136. directory$=""
  1137. print
  1138. print
  1139. print "Would you like to view more files? ";
  1140.  
  1141. wait10:
  1142. gosub continue:
  1143. if a$="y" then seefil40:
  1144. if a$="Y" then seefil40:
  1145.  
  1146. if a$="n" then
  1147. end
  1148. endif
  1149.  
  1150. if a$="N" then
  1151. end
  1152. endif
  1153.  
  1154. goto wait10:
  1155.  
  1156. rem THIS IS THE END OF THE ROUTINE FOR VIEWING FILES IN 40-COLUMN MODE.
  1157.  
  1158.  
  1159. rem HERE IS THE ROUTINE FOR MOVING TEXT FILES.
  1160.  
  1161. movefile:
  1162. cls
  1163. print "                                   Move File"
  1164. print
  1165. print
  1166. print "*****PLEASE NOTE***** Only text files will move properly using this"
  1167. print "method.  Files with an extension of .EXE, .COM, or which contain other"
  1168. print "special characters will usually not move properly.  In addition, this"
  1169. print "option is destructive, destroying the original file.  You are urged"
  1170. print "to make backups before attempting any procedure which can change a"
  1171. print "file."
  1172. print
  1173. print "Press Esc to quit, or any other key to continue. ";
  1174. gosub continue:
  1175. if a$=b$ then menu:
  1176.  
  1177. movemore:
  1178. cls
  1179. spaces$=space$(68)
  1180. print spaces$;
  1181. color 0,7
  1182. print "Esc=Quit"
  1183. color 7,0
  1184. print "File to move (include drive and path)? ";
  1185. gosub retypefi:
  1186. file1$=file$
  1187. realfil1$=ucase$(file1$)
  1188. file$=""
  1189.  
  1190. print ""
  1191. print "Destination (include drive and path)? ";
  1192. gosub retypefi:
  1193. file2$=file$
  1194. realfil2$=ucase$(file2$)
  1195. file$=""
  1196.  
  1197. domove:
  1198. reinputm:
  1199. open "i",1,file1$
  1200. if error=2 then nofilemf:
  1201.  
  1202. if error=3 then
  1203. io=1
  1204. goto nopathmf:
  1205. endif
  1206.  
  1207. reoutpum:
  1208. open "o",2,file2$
  1209.  
  1210. if error=3 then
  1211. io=2
  1212. goto nopathmf:
  1213. endif
  1214.  
  1215. if error=5 then noopenmf:
  1216.  
  1217. wait26:
  1218. input # 1, line$ crlf
  1219. if error=99 then movedone:
  1220.  
  1221. if error=96 then
  1222. print # 2, line$ nonull
  1223. input # 1, line$ crlf
  1224. if line$="" then
  1225. print # 2, crlf$ nonull
  1226. goto wait26:
  1227. endif
  1228. endif
  1229.  
  1230. print # 2, line$ nonull
  1231. print # 2, crlf$ nonull
  1232. goto wait26:
  1233.  
  1234. movedone:
  1235. close 1
  1236. close 2
  1237. kill file1$
  1238. print ""
  1239. print ""
  1240. print realfil1$;
  1241. print " has been moved to ";
  1242. print realfil2$;
  1243. print "."
  1244. print
  1245. print "Move another? ";
  1246.  
  1247. a$=""
  1248. while a$=""
  1249. gosub continue:
  1250. if a$="y" then movemore:
  1251. if a$="Y" then movemore:
  1252. if a$="n" then menu:
  1253. if a$="N" then menu:
  1254. wend
  1255.  
  1256. rem THIS IS THE END OF THE ROUTINE FOR MOVING A FILE.
  1257.  
  1258. menu:
  1259. end
  1260.  
  1261.  
  1262. rem .........................................................................
  1263.  
  1264. rem ERROR ROUTINES
  1265.  
  1266. rem .........................................................................
  1267.  
  1268.  
  1269. rem HERE IS THE ERROR ROUTINE FOR FILE NOT FOUND (ERROR 2, READFILE:)
  1270.  
  1271. nofilerd:
  1272. file$=""
  1273. cls
  1274. print "Hi.  The file you've selected can't be found.  Please check your"
  1275. print "spelling and/or path, and try again.  To return to the Main Options"
  1276. print "Menu, press Esc at any time."
  1277. print
  1278. print
  1279. print "File? ";
  1280. gosub retypefi:
  1281. return
  1282.  
  1283. rem THIS IS THE END OF THE ERROR ROUTINE FOR FILE NOT FOUND (READFILE:)
  1284.  
  1285.  
  1286. rem HERE IS THE ERROR ROUTINE FOR PATH NOT FOUND (READFILE:)
  1287.  
  1288. nopathrd:
  1289. file$=""
  1290. cls
  1291. print "Hi.  The path you've specified can't be found.  Please check your"
  1292. print "spelling and path, and try again.  To quit and return to the Main Op-"
  1293. print "tions Menu, press Esc at any time."
  1294. print
  1295. print "File to read? ";
  1296. gosub retypefi:
  1297. goto reread:
  1298.  
  1299. rem THIS IS THE END OF THE ERROR ROUTINE FOR PATH NOT FOUND (READFILE:)
  1300.  
  1301.  
  1302. rem HERE IS THE ERROR ROUTINE FOR PATH NOT FOUND (PRINTFIL:)
  1303.  
  1304. nopathpr:
  1305. file$=""
  1306. cls
  1307. print "Hi.  The path you've specified can't be found.  Please check your"
  1308. print "spelling and path and try again.  To quit and return to the Main Op-"
  1309. print "tions Menu, press Esc at any time."
  1310. print
  1311. print "File to print? ";
  1312. gosub retypefi:
  1313. realfile$=ucase$(file$)
  1314. goto doprintf:
  1315.  
  1316. rem THIS IS THE END OF THE ERROR ROUTINE FOR PATH NOT FOUND (PRINTFIL:)
  1317.  
  1318.  
  1319. rem HERE IS THE ERROR ROUTINE FOR FILE NOT FOUND (COPYFILE:)
  1320.  
  1321. nofilecf:
  1322. file1$=""
  1323. cls
  1324. print "Hi.  The file you've specified can't be found.  Please check your"
  1325. print "spelling and try again.  To quit and return to the Main Options Menu"
  1326. print "press Escape at any time."
  1327. print
  1328. print "File to copy? ";
  1329. gosub retypefi:
  1330. file1$=file$
  1331. realfil1$=ucase$(file1$)
  1332. goto reinput:
  1333.  
  1334. rem THIS IS THE END OF THE ERROR ROUTINE FOR FILE NOT FOUND (COPYFILE:)
  1335.  
  1336.  
  1337. rem HERE IS THE ERROR  ROUTINE FOR PATH NOT FOUND (COPYFILE:)
  1338.  
  1339. nopathcf:
  1340. cls
  1341. print "Hi.  The path you've specified can't be found.  Please check your"
  1342. print "spelling and path, and try again.  To quit and return to the Main Op-"
  1343. print "tions Menu, press Esc at any time."
  1344. print
  1345.  
  1346. if labelnum=1 then
  1347. file1$=""
  1348. print "File to copy? ";
  1349. gosub retypefi:
  1350. file1$=file$
  1351. realfil1$=ucase$(file1$)
  1352. goto reinput:
  1353. endif
  1354.  
  1355. if labelnum=2 then
  1356. file2$=""
  1357. print "Destination for ";
  1358. print realfil1$;
  1359. print "? ";
  1360. gosub retypefi:
  1361. file2$=file$
  1362. realfil2$=ucase$(file2$)
  1363. goto reoutput:
  1364. endif
  1365.  
  1366. rem THIS IS THE END OF THE ROUTINE FOR PATH NOT FOUND (COPYFILE:)
  1367.  
  1368.  
  1369. rem HERE IS THE ERROR ROUTINE FOR ACCESS DENIED (COPYFILE:)
  1370.  
  1371. cantopen:
  1372. file2$=""
  1373. cls
  1374. print "Hi.  The file you've specified for the destination can't be opened."
  1375. print "The most likely reason is that a file of that name already exists, and"
  1376. print "is set to read-only status.  Please type another destination name for"
  1377. print realfil1$;
  1378. print "."
  1379. print
  1380. print "To quit and return to the Main Options Menu, press Esc at any time."
  1381. print
  1382. print "Destination for ";
  1383. print realfil1$;
  1384. print "? ";
  1385. gosub retypefi:
  1386. file2$=file$
  1387. realfil2$=ucase$(file2$)
  1388. goto reoutput:
  1389.  
  1390. rem THIS IS THE END OF THE ROUTINE FOR ACCESS DENIED (COPYFILE:)
  1391.  
  1392.  
  1393. rem THIS IS THE ERROR ROUTINE FOR PATH NOT FOUND (CHANGEDI:)
  1394.  
  1395. nopathch:
  1396. cls
  1397. print "Hi.  The path you've specified can't be found.  Please check your"
  1398. print "spelling and path and try again.  To quit and return to the Main"
  1399. print "Options Menu, press Esc at any time."
  1400. print
  1401. print
  1402. print "Directory to change to? ";
  1403. gosub retypefi:
  1404. directory$=file$
  1405. file$=""
  1406. goto rechange:
  1407.  
  1408. rem THIS IS THE END OF THE ROUTINE FOR PATH NOT FOUND (CHANGEDI:)
  1409.  
  1410.  
  1411. rem HERE IS THE ERROR ROUTINE FOR FILE NOT FOUND (MOVEFILE:)
  1412.  
  1413. nofilemf:
  1414. file1$=""
  1415. cls
  1416. print "Hi.  The file you've specified can't be found.  Please check your"
  1417. print "spelling and path, and try again.  To quit and return to the Main"
  1418. print "Options Menu, press Esc at any time."
  1419. print
  1420. print "File to move? ";
  1421. gosub retypefi:
  1422. file1$=file$
  1423. realfil1$=ucase$(file1$)
  1424. goto reinputm:
  1425.  
  1426. rem THIS IS THE END OF THE ERROR ROUTINE FOR FILE NOT FOUND (MOVEFILE:)
  1427.  
  1428.  
  1429. rem HERE IS THE ERROR ROUTINE FOR PATH NOT FOUND (MOVEFILE:)
  1430.  
  1431. nopathmf:
  1432. cls
  1433. print "Hi.  The path you've specified can't be found.  Please check your"
  1434. print "spelling and path, and try again.  To quit and return to the Main"
  1435. print "Options Menu, press Esc at any time."
  1436. print
  1437.  
  1438. if io=1 then
  1439. file1$=""
  1440. print "File to move? ";
  1441. gosub retypefi:
  1442. file1$=file$
  1443. realfil1$=ucase$(file1$)
  1444. goto reinputm:
  1445. endif
  1446.  
  1447. if io=2 then
  1448. file2$=""
  1449. print "Destination for ";
  1450. print realfil1$;
  1451. print "? ";
  1452. gosub retypefi:
  1453. file2$=file$
  1454. realfil2$=ucase$(file2$
  1455. goto reoutpum:
  1456. endif
  1457.  
  1458. rem THIS IS THE END OF THE ERROR ROUTINE FOR PATH NOT FOUND (MOVEFILE:)
  1459.  
  1460.  
  1461. rem HERE IS THE ERROR ROUTINE FOR ACCESS DENIED (MOVEFILE:)
  1462.  
  1463. noopenmf:
  1464. file2$=""
  1465. cls
  1466. print "Hi.  The file you've specified as your destination exists and is"
  1467. print "protected.  DOS will not allow you to overwrite that file.  Please"
  1468. print "enter another file as the destination.  To quit and return to the Main"
  1469. print "Options Menu, press Esc at any time."
  1470. print
  1471. print "Destination for ";
  1472. print realfil1$;
  1473. print "? ";
  1474. gosub retypefi:
  1475. file2$=file$
  1476. realfil2$=ucase$(file2$)
  1477. goto reoutpum:
  1478.  
  1479. rem THIS IS THE END OF THE ERROR ROUTINE FOR ACCESS DENIED (MOVEFILE:)
  1480.  
  1481.  
  1482. rem .........................................................................
  1483.  
  1484. rem THIS IS THE END OF THE ERROR ROUTINES.
  1485.  
  1486. rem .........................................................................
  1487.  
  1488.  
  1489.  
  1490. rem Here is the subroutine for initializing row/column position of cursor.
  1491.  
  1492. cursor:
  1493. a=csrlin
  1494. b=pos(0)
  1495. c=b-1
  1496. return
  1497.  
  1498. rem This is the end of the routine for initializing cursor position.
  1499.  
  1500.  
  1501. rem Here is the routine for continuing when the user presses a key.
  1502.  
  1503. continue:
  1504. a$=inkey$
  1505. if a$="" then continue:
  1506. return
  1507.  
  1508. rem This is the end of the routine for continuing when the user presses a key.
  1509.  
  1510. end
  1511.