AT2k Design BBS Message Area
Casually read the BBS message area using an easy to use interface. Messages are categorized exactly like they are on the BBS. You may post new messages or reply to existing messages! You are not logged in. Login here for full access privileges. |
Previous Message | Next Message | Back to BAT Magic <-- <--- | Return to Home Page |
|
||||||
From | To | Subject | Date/Time | |||
Visitor | ALL | MAKEMENU |
November 29, 1995 2:00 PM * |
|||
Title: "Menus by the Batch" Reference: PC World April 1990 Author: Jim Dawson Files: MAKEMENU.DOC, MAKEMENU.BAS, CHOICE.COM Shaded-window menus frequently found in commercial software are impressive. To create similar results in DOS batch files, run the QuickBASIC program, MAKEMENU.BAS. The program creates a batch file that displays up to eight menu items that you can program to run applications and issue other commands. To create a menu batch file, run MAKEMENU.BAS with QuickBASIC 4.5. [ I USED QBASIC, WORKED FINE.] Answer the prompts for a menu title, the number of selections (from 1 to 8), and the text to display for each selection. When MAKEMENU asks for an output file name, press <Enter> to create MENU.BAT, or enter a different name. You'll also need to copy CHOICE.COM to a directory in your PATH. The MAKEMENU.BAS batch file calls CHOICE.COM to position the cursor and return ERRORLEVEL responses. Before running a MAKEMENU batch file, check that CHOICE.COM is in the current path, and that CONFIG.SYS contains the line DEVICE=d:\path\ANSI.SYS where d:\path is the optional drive and path for ANSI.SYS. Use a text editor to place appropriate commands after the :CHOICEn labels in the menu batch file, leaving the GOTO START commands in place. MAKEMENU.BAS: cls : screen 0 : defint a-z : dim ch$(8), m$(15), shadow$(2) '---- Get title, menu choices, and file name getname: input "Menu title (up to 40 characters): ", t1$ if (len(t1$) = 0) or (len(t1$) > 40) then print "ERROR: No name, or name too long." : goto getname end if getchoice: input "Number of menu choices (1 to 8): ", choices if (choices < 1) or (choices > 8) then print "ERROR: Number out of range." : goto getchoice end if name$ = " === " + t1$ + " === " for i = 1 to choices print "Enter text for selection #"; ltrim$(str$(i)); ": "; input "", ch$(i) : ch$(i) = str$(i) + " - " + ch$(i) next i input "Enter file name [default = MENU.BAT]: ", batch$ if len(batch$) = 0 then batch$ = "MENU.BAT" '---- Prepare display and batch-file string constants prompt$ = "Enter selection number, or press Esc to quit:" echo$ = "echo " : cls$ = "cls" : shadow$(1) = string$(2,177) shadow$(2) = string$(53,177) : blank$ = string$(42,32) m$(1) = string$(54,219) : m$(3) = string$(6,219) m$(4) = m$(3) + blank$ + m$(3) + shadow$(1) m$(5) = m$(1) + shadow$(1) : nn = len(name$) if (nn mod 2) = 1 then name$ = name$ + chr$(219) t1$ = left$(m$(1), 27 - nn / 2) m$(6) = t1$ + name$ + t1$ + shadow$(1) m$(7) = m$(3) + blank$ + m$(3) '---- Create menu selection names for i = 1 to choices t1$ = left$(m$(4), 7) + ch$(i) t2$ = right$(m$(4), (49 - len(ch$(i)))) m$(i + 7) = t1$ + t2$ next i '---- Create batch file and write starting commands open batch$ for output as #1 print #1, "@echo off" print #1, ":start" print #1, cls$ print #1, "echo." '---- Write menu display echo statements print #1, echo$; spc(12); m$(1) print #1, echo$; spc(12); m$(6) print #1, echo$; spc(12); m$(5) for i = 1 to choices print #1, echo$; spc(12); m$(i + 7) print #1, echo$; spc(12); m$(5) next i print #1, echo$; spc(12); m$(5) print #1, echo$; spc(15); shadow$(2) print #1, echo$; chr$(27); "[24;18H"; prompt$ '---- Write menu selection statements print #1, ":getchoice" print #1, "choice" print #1, "if errorlevel 27 goto end" print #1, "if errorlevel"; str$(choices + 1); " goto getchoice" for i = choices to 2 step -1 n$ = ltrim$(str$(i)) print #1, "if errorlevel "; n$; " goto choice"; n$ next i '---- Write dummy commands for each selection for i = 1 to choices n$ = ltrim$(str$(i)) print #1, ":choice"; n$ print #1, cls$ print #1, echo$; "Choice #"; n$ print #1, "pause" print #1, "goto start" next i '---- Print final lines and close the file print #1, ":end" print #1, cls$ close #1 print : print : print print "Your menu batch file, "; batch$; ", has been saved." ___ Blue Wave/QWK v2.12 |
||||||
|
Previous Message | Next Message | Back to BAT Magic <-- <--- | Return to Home Page |
Execution Time: 0.0125 seconds If you experience any problems with this website or need help, contact the webmaster. VADV-PHP Copyright © 2002-2024 Steve Winn, Aspect Technologies. All Rights Reserved. Virtual Advanced Copyright © 1995-1997 Roland De Graaf. |