home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
menu
/
genmenu.arc
/
MENUGEN.BAS
next >
Wrap
BASIC Source File
|
1987-02-23
|
4KB
|
100 lines
5 ' ***********************************
10 ' *** DOS Menu Generator ***
20 ' *** Michael S. Cox ***
25 ' *** Version V2.6 ***
26 ' *** February 23, 1987 ***
30 ' ***********************************
40 '
50 key off
60 screen 0
70 '
80 ' *** get user specs
90 '
100 cls:?:input "Menu Filename to create {no extension} ";mnufile$
105 if len(mnufile$) > 8 then ?"Too long, 8 characters max.":goto 100
130 ?:input "Specify Drive Name for Menu File to Reside {A:,B:,C:} ";drv$
140 if drv$ = "A:" or drv$ = "B:" or drv$ = "C:" then 145 ELSE 130
145 mnufile$ = drv$+mnufile$+".BAT"
150 cls
160 print "You may now enter the number of choices your menu will contain."
170 print "NOTE: If you want your menu choices double spaced, you must"
180 print " have no more than 7 choices with a Menu Title, or 9"
190 print " choices with no menu title. If you have your menu"
200 print " choices single spaced, you must have no more than 16"
210 print " choices with no Menu Title, or no more than 19 without"
220 print " a Menu Title."
230 ?:input "Number of choices ";nmbch
240 cls
245 COLOR 0,7:PRINT "Working...":COLOR 7,0
250 '
260 ' *** open file and set up menu
270 '
280 open mnufile$ for output as #1
285 print #1,"ECHO OFF"
290 print #1,"REM *** Menu File Created by MENUGEN V2.6"
300 print #1,"REM ***"
310 print #1,":MENU"
320 PRINT #1,"CLS"
330 PRINT #1,"ECHO ";CHR$(255)
340 '
350 CLS:?:INPUT "Do you wish to have a Menu Title [Y/N] ";yn$
360 if yn$ = "y" or yn$ = "Y" then input "Title {no quotes} ";title$
370 PRINT #1,"ECHO ";CHR$(201);:FOR L = 1 TO 60:PRINT #1,CHR$(205);:NEXT L:PRINT #1,CHR$(187)
380 LN$ = "ECHO "+CHR$(186)+" "+CHR$(186)
400 IF TITLE$ = "" THEN 420 ELSE 410
410 PRINT #1,LN$
411 LET B = LEN(TITLE$)/2:IF B = INT(B) THEN TITLE$=TITLE$+" ":GOTO 411
412 :LET TS = 32-B
419 PRINT #1,"ECHO ";CHR$(186);:FOR L=1 TO TS:PRINT #1,CHR$(255);:NEXT L:PRINT #1,TITLE$;:FOR L=1 TO TS-3:PRINT #1,CHR$(255);:next l:print #1,CHR$(186)
420 PRINT #1,LN$
425 cls:?:?"If Menu Choices contain punctuation such as commas, please enclose"
426 ?"entire Menu Choice in quotes."
427 CHRCNT = 64
429 ?:?"Please keep track of your choices and what order you give them.":?
430 FOR LNCNT = 1 TO NMBCH
435 CHRCNT = CHRCNT + 1
440 print "Menu Choice #";lncnt;" "
445 INPUT MNCH$
446 LET CNCH = LEN(MNCH$)
447 LET CNT = 52 - CNCH
450 PRINT #1,"ECHO ";CHR$(186);" [";CHR$(CHRCNT);"] ";MNCH$;:FOR L=1 TO CNT:PRINT #1,CHR$(255);:NEXT L:PRINT #1,CHR$(186)
455 IF NMBCH > 11 THEN 460 ELSE PRINT #1, LN$
460 NEXT LNCNT
461 CHRCNT = CHRCNT + 1
462 ex = chrcnt
466 PRINT #1,"ECHO ";CHR$(186);" [";CHR$(CHRCNT);"] ";"Exit";:for l=1 to 48:print #1,chr$(255);:next l:print #1,chr$(186)
467 chrcnt = chrcnt -1
468 print #1,ln$
469 PRINT #1,"ECHO ";CHR$(200);:FOR I = 1 TO 60:PRINT #1,CHR$(205);:NEXT I:PRINT #1,CHR$(188)
470 PRINT #1,"ECHO ";CHR$(255)
480 PRINT #1,"ECHO Please Make Selection..."
481 PRINT #1,"OPTION"
485 EL = CHRCNT + 2
490 PRINT #1," "
500 PRINT #1, "IF ERRORLEVEL";EL;"GOTO MENU
510 PRINT #1, "IF ERRORLEVEL";EX;"GOTO END
515 EL = EL - 1
520 FOR ELCNT = 1 TO NMBCH
530 el = el - 1
535 PRINT #1, "IF ERRORLEVEL";EL;"GOTO ";CHR$(EL)
540 NEXT ELCNT
550 PRINT #1,"GOTO MENU"
560 CLS:?
561 CHRCNT = 64
565 for lncnt = 1 TO NMBCH
566 CHRCNT = CHRCNT + 1
570 print "Command Use to Load Choice #";lncnt
580 INPUT CMD$
590 PRINT #1,":";CHR$(CHRCNT)
600 PRINT #1,CMD$
610 PRINT #1,"GOTO MENU"
620 NEXT LNCNT
630 PRINT #1,":END"
640 PRINT #1,"CLS"
650 CLOSE #1
660 CLS:?:?"Menu file ";mnufile$;" has been created."
670 ?:input"Generate Another Menu [Y/N] ";yn$
680 if yn$ = "Y" or yn$ = "y" then run else cls:end
690 '
700 ' *** done file