home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progbas
/
gwbsu102.arj
/
START.ASI
< prev
next >
Wrap
Text File
|
1992-01-29
|
19KB
|
952 lines
start:
rem This version of START.COM is for the GW-BASIC 3.22 Support Disk.
rem It requires approximately 68K of available RAM.
rem First, initialize Esc key (necessary when parameters are used, since you
rem bypass the menus, where it would otherwise be initialized).
b$=chr$(27)
rem Next, intitialize the space bar.
e$=chr$(32)
rem Here are the parameters for accessing different parts of START.COM from
rem the DOS prompt.
rem First, the 80-column parameters.
a$=command$
if a$=" /?" then help:
if a$=" /v" then listfile:
if a$=" /V" then listfile:
if a$=" /r" then readfile:
if a$=" /R" then readfile:
if a$=" /p" then printdoc:
if a$=" /P" then printdoc:
if a$=" /d" then donation:
if a$=" /D" then donation:
rem Next, the parameters for 40-column mode.
if a$=" /40" then option40:
if a$=" /40 ?" then help40:
if a$=" /40 v" then listfl40:
if a$=" /40 V" then listfl40:
if a$=" /40 r" then rdfile40:
if a$=" /40 R" then rdfile40:
if a$=" /40 p" then prfile40:
if a$=" /40 P" then prfile40:
if a$=" /40 d" then donate40:
if a$=" /40 D" then donate40:
rem If no parameters, begin from the beginning.
cls
print " The GW-BASIC 3.22 Support Disk 1.00"
print
print
print " by Matt Roberts"
print " 3 Cedar St., # 8"
print " Montpelier, Vt 05602-3006"
print " (802)223-2553"
print
print
print "If you have trouble running the files on this disk, and the documenta-"
print "tion doesn't seem to help, you can call between 9AM and 9PM EST, and"
print "I'll try to help."
print
print "If you find the files on this disk useful, a donation of $5.00 would"
print "be greatly appreciated. Thanks."
print
print "Of course, if there's work by other authors here, the $5.00 doesn't"
print "cover them. Thanks for your understanding."
print
print
print
print "Press any key to continue. ";
gosub continue:
rem Here is the menu routine.
options:
cls
print "You have the following options:"
print
print
print "F1- View a list of the files on this disk."
print
print "F2- View the text file(s) of your choice, on the screen."
print
print "F3- Print the text file(s) of your choice."
print
print "F4- Shell to DOS."
print
print "F5- Switch to 40-column mode (larger text, easier to read; probably"
print "most useful to the visually impaired."
print
print "F6- See a list of the parameters you can use from the DOS prompt."
print
print "Esc- Return to DOS."
print
print
print "Please press the key corresponding to your choice. ";
wait1:
gosub continue:
if a$=b$ then finish:
if extended=1 then readext:
goto wait1:
rem This routine reads the symbols returned by the Function (or other
rem extended) keys and initiates action based upon the key pressed. In this
rem case, only the Function keys F1-F6 are accepted. All other keypresses
rem are ignored.
readext:
if a$=";" then listfile:
if a$="<" then readfile:
if a$="=" then printdoc:
if a$=">" then shell:
if a$="?" then option40:
if a$="@" then help:
goto wait1:
rem Here is the routine for viewing a list of disk files.
listfile:
cls
print "Here are the files on this disk:"
print
print
print "COMPUTER.DOC- A short list of the computers used to test these files."
print
print "DARKSCRN.BAS- A screen blanking utility, run from within GW-BASIC."
print
print "DARKSCRN.DOC- The documentation for DARKSCRN.BAS"
print
print "FILE-MAN.BAS- The GW-BASIC 3.22 File Manager."
print
print "FILE-MAN.DOC- The documentation for FILE-MAN.BAS."
print
print "LIST.COM- A neat utility by Vern Buerg; displays files on the screen."
print
print "LOOSWARE.DOC- Notes on the looseware concept."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "START.ASI- The ASIC 3.01 source code for START.COM."
print
print "START.COM- The file you're using right now."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
rem Here is the routine for viewing the text file of your choice, on the
rem screen.
readfile:
cls
print "To move ahead in the file(s) you are about to view, press PgDn."
print
print "To move back, press PgUp."
print
print "To exit the document, press Esc."
print
print
print "Press any key to see the menu of files. ";
gosub continue:
readmenu:
cls
print "Here are the files you can view:"
print
print
print "A- COMPUTER.DOC"
print
print "B- DARKSCRN.BAS"
print
print "C- DARKSCRN.DOC"
print
print "D- FILE-MAN.BAS"
print
print "E- FILE-MAN.DOC"
print
print "F- NOT IN USE"
print
print "G- LOOSWARE.DOC"
print
print "H- START.ASI"
print
print "Esc- Return to the Main Options Menu."
print
print
print "Please press the key corresponding to your choice. ";
gosub continue:
if a$=b$ then options:
print a$;
if a$="h" then readstar:
if a$="H" then readstar:
if a$="g" then readloos:
if a$="G" then readloos:
if a$="f" then readmenu:
if a$="F" then readmenu:
if a$="e" then readfild:
if a$="E" then readfild:
if a$="d" then readfilb:
if a$="D" then readfilb:
if a$="c" then readdard:
if a$="C" then readdard:
if a$="b" then readdarb:
if a$="B" then readdarb:
if a$="a" then readcomp:
if a$="A" then readcomp:
goto readmenu:
readcomp:
call ("list.com"," computer.doc")
goto readmenu:
readdarb:
call ("list.com"," darkscrn.bas")
goto readmenu:
readdard:
call ("list.com"," darkscrn.doc")
goto readmenu:
readfilb:
call ("list.com"," file-man.bas")
goto readmenu:
readfild:
call ("list.com"," file-man.doc")
goto readmenu:
readloos:
call ("list.com"," loosware.doc")
goto readmenu:
readstar:
call ("list.com"," start.asi")
goto readmenu:
rem Here is the routine for printing the text file of your choice.
printdoc:
cls
print "Please ready your printer; press any key to see the menu of files. ";
gosub continue:
printmen:
cls
print "Here are the files you can print:"
print
print
print "A- COMPUTER.DOC"
print
print "B- DARKSCRN.BAS"
print
print "C- DARKSCRN.DOC"
print
print "D- FILE-MAN.BAS"
print
print "E- FILE-MAN.DOC"
print
print "F- NOT IN USE"
print
print "G- LOOSWARE.DOC"
print
print "H- START.ASI"
print
print "Esc- Return to the Main Options Menu."
print
print
print "Please press the key corresponding to your choice. ";
wait5:
gosub continue:
if a$=b$ then options:
if a$="h" then printsta:
if a$="H" then printsta:
if a$="g" then printloo:
if a$="G" then printloo:
if a$="f" then printmen:
if a$="F" then printmen:
if a$="e" then printfid:
if a$="E" then printfid:
if a$="d" then printfib:
if a$="D" then printfib:
if a$="c" then printdad:
if a$="C" then printdad:
if a$="b" then printdab:
if a$="B" then printdab:
if a$="a" then printcom:
if a$="A" then printcom:
goto wait5:
printcom:
file$="computer.doc"
gosub printfil:
goto printmen:
printdab:
file$="darkscrn.bas"
gosub printfil:
goto printmen:
printdad:
file$="darkscrn.doc"
gosub printfil:
goto printmen:
printfib:
file$="file-man.bas"
gosub printfil:
goto printmen:
printfid:
file$="file-man.doc"
gosub printfil:
goto printmen:
printloo:
file$="loosware.doc"
gosub printfil:
goto printmen:
printsta:
file$="start.asi"
gosub printfil:
goto printmen:
rem Here is the routine for printing a file.
printfil:
cls
f$=chr$(12)
open "i",1,file$
if error=2 then
print ""
print ""
print "File not found."
print
print
print "Press any key to continue. ";
gosub continue:
close 1
return
endif
heading:
cls
print "Printing...";
realfile$=ucase$(file$)
color 0,7
print realfile$
color 7,0
print
print
print "Press space bar to pause printing, or Esc to quit."
print
print
printmor:
input# 1, line$ crlf
if error=96 then
lprint line$
goto blanklin:
endif
contlprn:
lprint line$
a$=inkey$
if a$=b$ then
print "Printing has been terminated. The printer may still have data in its"
print "buffer. If so, it will continue printing until the buffer is empty."
print
lprint f$
close 1
file$=""
print "Press any key to continue. ";
gosub continue:
return
endif
if a$=e$ then pause: else nopause:
pause:
print "Press any key to resume printing. ";
pausemor:
a$=inkey$
if a$="" then pausemor:
a$=""
goto heading:
nopause:
if error=99 then eofp:
goto printmor:
blanklin:
input# 1, line$ crlf
if line$="" then printmor: else contlprn:
eofp:
lprint line$
print "Finished."
print
close 1
lprint f$
print "Press any key to continue. ";
gosub continue:
return
rem This is the end of the routine for printing text files.
rem Here is the routine for shelling to DOS.
shell:
cls
print "On which drive is your COMMAND.COM (don't type the colon)? ";
gosub continue:
path1$=a$+":"
path2$=path1$+"\"
path3$=path2$+"command.com"
cls
print "Use the DOS command EXIT to return to START.COM."
call path3$,""
goto options:
rem Here is the routine for changing to 40-column width. In order to get
rem decent screen writes, the program has to be rewritten for this mode.
rem A routine could probably be written to change 80-column mode to legible
rem 40-column writes, but it would probably slow down execution, and result in
rem little or no time saved. On the other foot, it would probably result in
rem less development time. I'm more interested in performance than saving
rem time, so I'll do it the long way.
option40:
width 40
print "You have the following options:"
print
print
print "F1- View a list of the files on this"
print "disk."
print
print "F2- View the text file of your choice,"
print "on the screen."
print
print "F3- Print the text file of your"
print "choice."
print
print "F4- Shell to DOS."
print
print "F5- Return to 80-column mode."
print
print "F6- See a list of the parameters you"
print "can use from the DOS prompt."
print
print "Esc- Return to DOS."
print
print
print "Please press the key corresponding to"
print "your choice. ";
wait2:
gosub continue:
if a$=b$ then finish:
if extended=1 then rdext40:
goto wait2:
rdext40:
if a$=";" then listfl40:
if a$="<" then rdfile40:
if a$="=" then prfile40:
if a$=">" then shell40:
if a$="?" then width80:
if a$="@" then help40:
goto wait2:
listfl40:
width 40
print "Here are the files on this disk:"
print
print
print "COMPUTER.DOC- Notes on the computers"
print "used to test the files on this disk."
print
print "DARKSCRN.BAS- A screen blanker to be"
print "used from within GW-BASIC."
print
print "DARKSCRN.DOC- The documentation for"
print "DARKSCRN.BAS."
print
print "FILE-MAN.BAS- The GW-BASIC 3.22 File"
print "Manager."
print
print "FILE-MAN.DOC- The documentation for"
print "FILE-MAN.BAS."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "LIST.COM- A neat utility by Vern Buerg"
print "that displays files on the screen."
print
print "LOOSWARE.DOC- Notes on the looseware"
print "concept."
print
print "START.ASI- The documentation for"
print "START.COM."
print
print "START.COM- The file you're using right"
print "now."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rdfile40:
width 40
print "To move ahead in the file(s) you are"
print "about to view, press PgDn."
print
print "To move back, press PgUp."
print
print "To move to the side, use the direction"
print "keys."
print
print
print "Press any key to see the menu of"
print "files. ";
gosub continue:
rdmenu40:
cls
print "Here are the files you can view:"
print
print
print "A- COMPUTER.DOC"
print
print "B- DARKSCRN.BAS"
print
print "C- DARKSCRN.DOC"
print
print "D- FILE-MAN.BAS"
print
print "E- FILE-MAN.DOC"
print
print "F- NOT IN USE"
print
print "G- LOOSWARE.DOC"
print
print "H- START.ASI"
print
print "Esc- Return to the Main Options Menu."
print
print
print "Please press the key corresponding to"
print "your choice. ";
gosub continue:
if a$=b$ then option40:
print a$;
if a$="h" then rdstar40:
if a$="H" then rdstar40:
if a$="g" then rdloos40:
if a$="G" then rdloos40:
if a$="f" then rdmenu40:
if a$="F" then rdmenu40:
if a$="e" then rdfild40:
if a$="E" then rdfild40:
if a$="d" then rdfilb40:
if a$="D" then rdfilb40:
if a$="c" then rddard40:
if a$="C" then rddard40:
if a$="b" then rddarb40:
if a$="B" then rddarb40:
if a$="a" then rdcomp40:
if a$="A" then rdcomp40:
goto rdmenu40:
rdcomp40:
call ("list.com"," computer.doc")
goto rdmenu40:
rddarb40:
call ("list.com"," darkscrn.bas")
goto rdmenu40:
rddard40:
call ("list.com"," darkscrn.doc")
goto rdmenu40:
rdfilb40:
call ("list.com"," file-man.bas")
goto rdmenu40:
rdfild40:
call ("list.com"," file-man.doc")
goto rdmenu40:
rdloos40:
call ("list.com"," loosware.doc")
goto rdmenu40:
rdstar40:
call ("list.com"," start.asi")
goto rdmenu40:
rem Here is the routine for the file-printing menu.
prfile40:
width 40
print "Please ready your printer; press any"
print "key to see the menu of files. ";
gosub continue:
prmenu40:
cls
print "Here are the files you can print:"
print
print
print "A- COMPUTER.DOC"
print
print "B- DARKSCRN.BAS"
print
print "C- DARKSCRN.DOC"
print
print "D- FILE-MAN.BAS"
print
print "E- FILE-MAN.DOC"
print
print "F- NOT IN USE"
print
print "G- LOOSWARE.DOC"
print
print "H- START.ASI"
print
print "Esc- Return to the Main Options Menu."
print
print
print "Please press the key corresponding to"
print "your choice. ";
wait6:
gosub continue:
if a$=b$ then option40:
if a$="h" then prstar40:
if a$="H" then prstar40:
if a$="g" then prloos40:
if a$="G" then prloos40:
if a$="f" then prmenu40:
if a$="F" then prmenu40:
if a$="e" then prfild40:
if a$="E" then prfild40:
if a$="d" then prfilb40:
if a$="D" then prfilb40:
if a$="c" then prdard40:
if a$="C" then prdard40:
if a$="b" then prdarb40:
if a$="B" then prdarb40:
if a$="a" then prcomp40:
if a$="A" then prcomp40:
goto wait6:
prcomp40:
file$="computer.doc"
gosub prndoc40:
goto prmenu40:
prdarb40:
file$="darkscrn.bas"
gosub prndoc40:
goto prmenu40:
prdard40:
file$="darkscrn.doc"
gosub prndoc40:
goto prmenu40:
prfilb40:
file$="file-man.bas"
gosub prndoc40:
goto prmenu40:
prfild40:
file$="file-man.doc"
gosub prndoc40:
goto prmenu40:
prloos40:
file$="loosware.doc"
gosub prndoc40:
goto prmenu40:
prstar40:
file$="start.asi"
gosub prndoc40:
goto prmenu40:
rem Here is the routine for printing a file in 40-column mode.
prndoc40:
cls
f$=chr$(12)
open "i",1,file$
if error=2 then
print ""
print ""
print "File not found."
print
print
print "Press any key to continue. ";
gosub continue:
close 1
return
endif
headng40:
cls
print "Printing...";
realfile$=ucase$(file$)
color 0,7
print realfile$
color 7,0
print
print
print "Press space bar to pause printing, or"
print "Esc to quit."
print
print
prntmr40:
input# 1, line$ crlf
if error=96 then
lprint line$
goto blnkln40:
endif
contpr40:
lprint line$
a$=inkey$
if a$=b$ then
print "Printing has been terminated. The"
print "printer may still have data in its"
print "buffer. If so, it will continue"
print "printing until the buffer is empty."
print
lprint f$
close 1
file$=""
print "Press any key to continue. ";
gosub continue:
return
endif
if a$=e$ then pause40: else nopaus40:
pause40:
print "Press any key to resume printing. ";
pausmr40:
a$=inkey$
if a$="" then pausmr40:
a$=""
goto headng40:
nopaus40:
if error=99 then eofp40:
goto prntmr40:
blnkln40:
input# 1, line$ crlf
if line$="" then prntmr40: else contpr40:
eofp40:
lprint line$
print "Finished."
print
close 1
lprint f$
print "Press any key to continue. ";
gosub continue:
return
rem This is the end of the routine for printing a file in 40-column mode.
rem Here is the routine for shelling to DOS in 40-column mode.
shell40:
cls
print "On which drive is your COMMAND.COM?"
print "Don't type the colon. ";
gosub continue:
path1$=a$+":"
path2$=path1$+"\"
path3$=path2$+"command.com"
call path3$,""
goto option40:
help40:
width 40
print "You can specify parameters with"
print "START.COM; they may save you time."
print
print
print "These parameters describe your options"
print "in 40-column mode. To get information"
print "on parameters with an 80-column dis-"
print "play, choose that option from the"
print "80-column menu, or type START /? from"
print "the DOS prompt."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Typing START /40 ? will get you this"
print "file."
print
print "Typing START /40 V will let you see a"
print "list of the files on this disk."
print
print "Typing START /40 R will let you view"
print "the text file of your choice, on the"
print "screen."
print ""
print "Typing START /40 P will let you print"
print "the text file of your choice."
print
print
print "Either upper or lower case is fine."
print
print
color 0,15
print "C";
color 7,0
print "ontinue with START.COM or return to "
color 0,15
print "D";
color 7,0
print "OS? ";
wait3:
gosub continue:
if a$="c" then option40:
if a$="C" then option40:
if a$="d" then finish:
if a$="D" then finish:
goto wait3:
width80:
width 80
goto options:
rem Here is the parameter-listing routine for 80-column mode.
help:
cls
print "You can specify parameters from the DOS prompt with START.COM; these"
print "may save you time."
print
print
print "These parameters describe your options in 80-column mode. To get"
print "information on parameters with a 40-column display, choose that option"
print "from the 40-column menu, or type START /40 ? from the DOS prompt."
print
print
print "Typing START /? will get you this file."
print
print "Typing START /V will let you see a list of the files on this disk."
print
print "Typing START /R will let you view the text file of your choice on the"
print "screen."
print
print "Typing START /P will let you print the text file of your choice."
print
print
print "Either upper or lower case is fine."
print
print
print "Would you like to ";
color 0,15
print "C";
color 7,0
print "ontinue with START.COM or return to ";
color 0,15
print "D";
color 7,0
print "OS? ";
wait4:
gosub continue:
if a$="c" then options:
if a$="C" then options:
if a$="d" then finish:
if a$="D" then finish:
goto wait4:
rem Here is the routine for giving the address for donations.
donation:
cls
print "You can send donations to:"
print
print
print "Matt Roberts."
print "3 Cedar St., # 8"
print "Montpelier, Vt 05602-3006"
print
print
print "Thanks."
print
print
end
rem Here is the donations routine for 40-column mode.
donate40:
width 40
print "You can send donations to:"
print
print
print "Matt Roberts"
print "3 Cedar St., # 8"
print "Montpelier, Vt 05602-3006"
print
print
print "Thanks."
print
print
end
rem Here is the routine for continuing by pressing a key.
continue:
wait:
a$=inkey$
if a$="" then wait:
return
rem Here is the routine for leaving the program.
finish:
cls
end