home *** CD-ROM | disk | FTP | other *** search
- :Batutil c(o) 1990 Barry Simon and Richard Wilson
- : Version 1.0
- echo off
- cls
- if x%1 == xok goto restart1
- batutil [@E]
- if errorlevel 40 goto restart
- cls
- echo Sorry; this batch file requires more than 40 bytes of free environment
- echo space. You have less; if you have DOS 3.2 or 3.3. use command
- echo with the /E: parameter.
- batutil [GE WA8 ELSE]
- goto wayend
- :echo1
- @0AWelcome to the demonstration of @8EBATUTIL@0A's menu making
- @0A You can make all sorts of menus and get the user's choice returned
- in the errorlevel and also in the environment. In a moment we'll
- show you a typical menu. For every menu we show you'll have to
- make a choice although the choice won't have any effect in this
- demo. After the first we'll show you the choice made and the command to
- make the menu. At any menu hitting $lEsc$g will exit the batch file.
- Now please hit a key to continue.
- :echo2
- this is a choice in the menu: #1
- this is a choice in the menu: #2
- this is a choice in the menu: #3
- this is a choice in the menu: #4
- this is a choice in the menu: #5
- @ This separates menu items from help text; the rest of the line is ignored
- You can also display a line of text for each menu item if you wish
- That way you can give up to 80 characters of extra explanation of menu items
- These lines will be centered and they can be very
- short
- or very looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
- Notice that extra help lines beyond the number of menu items get ignored
- :echo3
- You picked choice $x(RC)
- That menu was made with the command
-
- @1FBatutil {AT=00}{CL}{MH This is a wide menu}{FM %0 echo2}
-
- @1Ewhich uses the FMenu command to read in a menu from a file; in this
- case from this batch file itself! The help text is in the same file
-
- Do you wish to see that menu again(Y/N)?
- :echo4
- You picked choice $x(RC)
- That menu was made with the command:
-
- @1FBatutil $(AT 30$)$(MN 70$)$(SH$)$(MH This is a menu header$)$(ME ....$)
-
- @1E Do you wish to see that menu again(Y/N)?
- :echo5
- You picked choice $x(RC)
- That menu was made with the command:
-
- @1FBatutil {PO}{FK}{ME This$$Smenu$$Shas$$Sfunction key$$Schoices$$Salso}
-
- @1EIf one uses {PO +} instead of {PO} there are also sound effects
-
- What is your name, please
-
- :echo6
- You picked choice #$x(RC)
- That menu was made with the command:
- @1F Batutil $(MEnu a b c d e f g h i j k l m n$)
-
- Do you wish to see that menu again(Y/N)?
- :restart1
- set a=
- set b=
- :restart
- set cur=off
- batutil {AT=0A}{CL}{RO 8}{FP %0 echo1}{AS}
- if %RC%==27 goto end
- :firstmenu
- batutil {AT=30}{CL}{AT=0}{MN=70}{SH}{PO +}{MH $W, $E $H:$m}{ME Here$Sis$Sa$Smenu$Swith many$Sfancy$Sfeatures$Senabled}
- if not errorlevel 1 goto end
- batutil {AT=30}{EC $_$_$_$_You picked choice #%RC%$_ Do you wish to see that menu again (Y/N)?}{CU +}[GE N CR Y]
- if errorlevel 3 goto firstmenu
- batutil {AT=3F}{EC $_$_}{CO=5}{EC Menus can be tall and thin}{GE WA2}
- :secondmenu
- batutil {AT=00}{CL}{ME a b c d e f g h i j k l m n}{AT=1E}{CL}{RO=5}{CO=1}
- if %RC%==0 goto end
- batutil {FP %0 echo6}{CU +}[GE N CR Y]
- if errorlevel 3 goto secondmenu
- batutil {AT=4E}{EC $_$_ Or menus can be short and fat}{GE WA2}
- :thirdmenu
- set fo=this is a choice in the menu: #
- batutil {AT=0E}{CL}{MH This is a wide menu}{FM %0 echo2}{AT=1E}{CL}{RO=5}{CO=1}
- if %RC%==0 goto end
- batutil {AT=1E}{FP %0 echo3}{CU +}[GE N CR Y]
- if errorlevel 3 goto thirdmenu
- batutil {AT=4E}{EC $_$_ Menus can have headers and/or a shadow}{GE WA3}
- :fourthmenu
- batutil {AT=00}{CL}
- batutil {AT 30}{MN 70}{SH}{MH This is a menu header}{ME you$Scan$SpIck a$ScHoice$Swith The$Shighlighted$Scapital$Sletter}
- if %RC%==0 goto end
- batutil {AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo4}{CU +}[GE CR N Y]
- if errorlevel 3 goto fourthmenu
- batutil {AT=4E}{EC $_$_ Menus can explode with or without sound effects}{GE WA3}
- :fifthmenu
- batutil {AT=00}{CL}{PO}{FK}{ME This$Smenu$Shas$Sfunction key$Schoices$Salso}
- if %RC%==0 goto end
- batutil {AT=1E}{CL}{RO=5}{CO=1}{FP %0 echo5}{set name=$Q}
- batutil {CL}{MH $x(name)'s Menu}{me eXit Last$Smenu Restart}
- if errorlevel 3 goto restart
- if errorlevel 2 goto fifthmenu
- :end
- set fo=
- set rc=
- set cur=
- batutil {CL}{set cur=}{RO 5}{CO 5}{PR Thank @1Fyou @1Efor trying @1FBATUTIL!$_}
- goto waywayend
- :wayend
- cls
- echo
- echo
- echo
- echo Thank you for trying BATUTIL
- :waywayend
-