home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boldly Go Collection
/
version40.iso
/
TS
/
10A
/
BATCH30.ZIP
/
BENDEMO.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-07-15
|
11KB
|
212 lines
@ECHO OFF
:BENDEMO.BAT - A Demo Batch File That Demonstrates BEN
:(C) 1992 by Simvis Soft
:All Rights Reserved
:This batch file requires BENDEMO.DA1 through BENDEMO.DA6
:to function properly. Also, ANSI.SYS should by installed.
:Otherwise, some minor color errors will occur.
BEN SAVEPATH
BEN T BENDEMO.DA1
IF ERRORLEVEL 2 GOTO CloseDown
IF "%BEN%"=="" SET BEN=Nameless
SET NAME=%BEN%
:MainMenu
BEN T BENDEMO.DA2
IF ERRORLEVEL 8 GOTO CloseDown
IF ERRORLEVEL 7 GOTO VideoMode
IF ERRORLEVEL 6 GOTO ScrollingAround
IF ERRORLEVEL 5 GOTO SoundAndMusic
IF ERRORLEVEL 4 GOTO UserInput
IF ERRORLEVEL 3 GOTO EnhancedECHO
IF ERRORLEVEL 2 GOTO BoxesEveryWhere
IF ERRORLEVEL 1 GOTO DirectoryAndFiles
GOTO CloseDown
:----------------------------------------------------------------------------
:DirectoryAndFiles
BEN CLS LIGHTGRAY / SHADFILLEDBOX 6 3 75 23 BROWN GREEN 2
BEN LOCATE 1 9 / WRITEC WHITE GREEN %NAME%,~you~can~now~produce~batch~files
BEN WRITEC WHITE GREEN with~high~degree~of~control~over~directories~and~files!
BEN LOCATE 1 12 / WRITEC LIGHTCYAN GREEN Just~try~our~directory~dialog~box~first!
BEN LOCATE 1 14 / WRITEC BLUE GREEN Please~enter~a~pathname~(Eg.~C:\TELECOM\MODEM):
BEN BOX 19 16 58 16 BLACK LIGHTGRAY 0 / COLOR BLACK LIGHTGRAY
BEN LOCATE 20 16 / CURSOR FULL / FLUSH / GETLINE / CURSOR OFF
IF "%BEN%"=="" SET BEN=.
BEN DIRDISP %BEN%
IF "%BEN%"=="" GOTO SelectFileNot
:ReturnFromSelectFileNot
SET SELECT=%BEN%
BEN CLS LIGHTGRAY / TITLEDBOX 6 3 75 23 WHITE BLUE 1 With~BEN,~it's~easy~to~break~a~full~filename~into~its~components:
BEN LOCATE 25 10 / WRITE LIGHTGRAY BLUE Full~Filename:~; WRITE WHITE BLUE %SELECT%
BEN EXTRACT %SELECT% DRIVE
BEN LOCATE 25 11 / WRITE LIGHTGRAY BLUE Drive:~~~~~~~~~; / WRITE WHITE BLUE %BEN%
BEN EXTRACT %SELECT% PATH
BEN LOCATE 25 12 / WRITE LIGHTGRAY BLUE Path:~~~~~~~~~~; / WRITE WHITE BLUE %BEN%
BEN EXTRACT %SELECT% NAME
BEN LOCATE 25 13 / WRITE LIGHTGRAY BLUE Name:~~~~~~~~~~; / WRITE WHITE BLUE %BEN%
BEN EXTRACT %SELECT% EXTENSION
BEN LOCATE 25 14 / WRITE LIGHTGRAY BLUE Extension:~~~~~; / WRITE WHITE BLUE %BEN%
BEN EXTRACT %SELECT% FILENAME
BEN LOCATE 25 15 / WRITE LIGHTGRAY BLUE Filename:~~~~~~; / WRITE WHITE BLUE %BEN%
BEN GETCD
BEN LOCATE 1 21 / WRITEC YELLOW BLUE By~the~way,~you~are~currently~in~%BEN%!
BEN LOCATE 1 22 / WRITEC CYAN LIGHTBLUE Please~press~any~key~to~continue~.~.~. / FLUSH / PAUSE
BEN MESSAGE Now~you~are~going~to~examine~our~file browsing~capability.~Press~ENTER and~you~will~see~BENDEMO.BAT.
BEN LIST BENDEMO.BAT BENDEMO.BAT,~the~batch~file~you~are~running:
BEN MESSAGE Isn't~that~great?~Now~try~to~zoom, move~and~size~the~browsing~window!
BEN LIST BENDEMO.DA1 Try~to~zoom,~move~and~size~the~window~with~F5,~CTRL-F5~and~ALT-F5!
BEN MESSAGE What~you~have~seen~was~just~a~small part~of~BEN.~Go~ahead~and~select other~parts~of~the~demo!
GOTO MainMenu
:SelectFileNot
BEN MESSAGE You~left~without~selecting~any~file. Let's~assume~that~you~have~selected ~~~~~~~"C:\DOS\DISKCOPY.COM"
SET BEN=C:\DOS\DISKCOPY.COM
GOTO ReturnFromSelectFileNot
:----------------------------------------------------------------------------
:BoxesEveryWhere
BEN GROWFILLEDBOX 1 1 80 25 LIGHTGRAY BLUE 0 / LOCATE 1 12
BEN WRITEC WHITE BLUE With~BEN,~you~can~produce~many~kinds~of~neat~boxes~in~batch~files. / LOCATE 1 14
BEN WRITEC YELLOW BLUE Just~sit~back~and~enjoy~the~boxing~show. / DELAY 5000 / CLS LIGHTGRAY
BEN GROWFILLEDBOX 1 25 80 25 BLUE BLUE 0 / BOX 5 5 50 23 GREEN BLUE 1 / LOCATE 1 25 / WRITEC YELLOW BLUE Normal~Box;
BEN DELAY 3000 / FILLEDBOX 7 7 60 20 LIGHTGRAY BROWN 2 / LOCATE 1 25 / WRITEC YELLOW BLUE Filled~Box;
BEN DELAY 3000 / BOX 3 3 79 10 BLACK GREEN 251 / LOCATE 1 25 / WRITEC YELLOW BLUE ASCII~Bordered~Box;
BEN DELAY 3000 / TRANSPARENTBOX 10 3 40 15 CYAN MAGENTA / LOCATE 1 25 / WRITEC YELLOW BLUE ~~Transparent~Box~~;
BEN DELAY 3000 / SHADFILLEDBOX 15 5 75 21 LIGHTGRAY RED 5 / LOCATE 1 25 / WRITEC YELLOW BLUE ~~Shadowed~Box~~;
BEN DELAY 3000 / GROWFILLEDBOX 32 2 60 17 BLUE CYAN 0 / LOCATE 1 25 / WRITEC YELLOW BLUE ~Growing~Box~;
BEN DELAY 3000 / TITLEDBOX 3 3 78 22 YELLOW RED 1 Welcome~to~BENDEMO,~%NAME%!
BEN LOCATE 1 25 / WRITEC YELLOW BLUE ~Titled~Box~;
BEN DELAY 3000 / MESSAGE ~~~~And~Message~Box,~of~course! Press~ENTER~to~return~to~Main~Menu!
GOTO MainMenu
:----------------------------------------------------------------------------
:EnhancedECHO
BEN CLS BLACK / LOCATE 1 13 / WRITEC LIGHTGRAY BLACK Why~settle~for~the~plain~gray~on~black~ECHO~command?;
BEN CURSOR ON / DELAY 3000 / CURSOR OFF / CLS CYAN / GROWFILLEDBOX 5 3 76 23 BLUE BLUE 0
BEN WRITEV 77 5 DARKGRAY BLACK B~E~N~~~B~E~N~~~B~E
BEN LOCATE 28 4 / WRITE WHITE BLUE When~you~can~have~this:
BEN LOCATE 25 6 / WRITE LIGHTMAGENTA BLUE Hello / SOUND 50 50
BEN LOCATE 28 8 / WRITE GREEN BLUE user! / SOUND 100 100
BEN LOCATE 31 10 / WRITE RED BLUE Welcome / SOUND 75 100
BEN LOCATE 34 12 / WRITE LIGHTGREEN BLUE to / SOUND 50 100
BEN LOCATE 37 14 / WRITE YELLOW BLUE BEN, / SOUND 80 100
BEN LOCATE 40 16 / WRITE LIGHTCYAN BLUE the / SOUND 60 100
BEN LOCATE 43 18 / WRITE LIGHTMAGENTA BLUE Batch / SOUND 100 100
BEN LOCATE 45 20 / WRITE LIGHTGREEN BLUE ENhancer! / SOUND 75 100
BEN LOCATE 1 22 / WRITEC WHITE LIGHTBLUE Press~Any~Key~to~Continue~.~.~. / FLUSH / PAUSE
GOTO MainMenu
:----------------------------------------------------------------------------
:UserInput
BEN CLS RED GROWFILLEDBOX 5 3 76 23 WHITE MAGENTA 1
BEN LOCATE 1 10 / WRITEC WHITE MAGENTA BEN~is~very~good~with~dealing~with~user~input.
BEN LOCATE 1 12 / WRITEC YELLOW MAGENTA The~menu~that~brought~you~here~is~itself~a~fine~example.
BEN SHADFILLEDBOX 10 15 71 19 BLUE BLUE 0
BEN COLOR BLACK LIGHTGRAY / LOCATE 1 16 / WRITEC WHITE BLUE Please~enter~your~favourite~color,~%NAME%
:GetFColor
BEN BOX 30 18 50 18 BLACK LIGHTGRAY 0 / LOCATE 31 18 / CURSOR FULL / FLUSH / GETLINE / CURSOR OFF / SOUND 50 50
IF "%BEN%"=="" GOTO FColorEnteredNot
SET FCOLOR=%BEN%
BEN COLOR LIGHTGRAY BLACK / LOCATE 1 16 / WRITEC YELLOW BLUE ~Now,~enter~your~favourite~animal,~%NAME%~
:GetFAnimal
BEN BOX 30 18 50 18 LIGHTGRAY BLACK 0 / LOCATE 31 18 / CURSOR FULL / FLUSH / GETLINE / CURSOR OFF / SOUND 50 50
IF "%BEN%"=="" GOTO FAnimalEnteredNot
BEN GROWFILLEDBOX 10 5 71 21 CYAN CYAN 0 / LOCATE 1 7 / WRITEC BLACK CYAN We~have~a~conclusion:
BEN LOCATE 1 13 / WRITEC RED CYAN "%NAME%~loves~to~eat~%FCOLOR%~%BEN%!"
BEN LOCATE 1 18 / WRITEC BLUE LIGHTCYAN Ha!~Ha!~Ha!
BEN LOCATE 1 20 / WRITEC MAGENTA CYAN Please~press~any~key~to~go~on~with~our~demo~.~.~. / FLUSH / PAUSE
SET FColor=
BEN SHADFILLEDBOX 1 1 80 25 LIGHTCYAN RED 5 / GROWFILLEDBOX 10 8 70 14 BROWN BROWN 0
BEN LOCATE 1 9 / WRITEC YELLOW BROWN Now,~press~any~number~key~to~test~
BEN WRITEC YELLOW BROWN BEN's~key~handling~capability.
BEN WRITEC WHITE BROWN (Press~'Q'~to~quit)
BEN LOCATE 1 13 / WRITEC LIGHTCYAN BROWN (BEN~will~reject~all~other~keys)
:AskLoop
BEN ASK 1234567890Q
IF ERRORLEVEL 11 GOTO MainMenu
IF ERRORLEVEL 10 IF NOT ERRORLEVEL 11 SET BEN=0
IF ERRORLEVEL 9 IF NOT ERRORLEVEL 10 SET BEN=9
IF ERRORLEVEL 8 IF NOT ERRORLEVEL 9 SET BEN=8
IF ERRORLEVEL 7 IF NOT ERRORLEVEL 8 SET BEN=7
IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 SET BEN=6
IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 SET BEN=5
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 SET BEN=4
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 SET BEN=3
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 SET BEN=2
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 SET BEN=1
BEN SOUND 50 50 / LOCATE 1 18 / WRITEC LIGHTMAGENTA RED You~just~pressed~the~"%BEN%"~key!
GOTO AskLoop
:FColorEnteredNot
BEN MESSAGE Please~do~enter~something!
GOTO GetFColor
:FAnimalEnteredNot
BEN MESSAGE Please~do~enter~something!
GOTO GetFAnimal
:----------------------------------------------------------------------------
:SoundAndMusic
BEN T BENDEMO.DA3
rem Draws "The Music Work Shop" background by calling BENDEMO.DA3
:MusicAskLoop
BEN ASK EIBQ
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 GOTO MainMenu
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 GOTO SelectBeep
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 BEN T BENDEMO.DA5
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 BEN T BENDEMO.DA4
GOTO MusicAskLoop
:SelectBeep
BEN SCROLL 54 5 76 17 RIGHT / SCROLL 55 5 77 17 RIGHT / TRANSPARENTBOX 57 18 77 18 RED RED
BEN BEEP / SCROLL 56 5 78 18 LEFT / SCROLL 55 5 77 18 LEFT / TRANSPARENTBOX 57 18 77 18 0 0 / TRANSPARENTBOX 76 6 77 17 0 0
GOTO MusicAskLoop
:----------------------------------------------------------------------------
:ScrollingAround
BEN T BENDEMO.DA6
GOTO MainMenu
:----------------------------------------------------------------------------
:VideoMode
BEN GROWFILLEDBOX 5 3 76 23 WHITE BLUE 1 / GETVIDEO
BEN LOCATE 1 10 / WRITEC WHITE BLUE Let's~see~what~kind~of~video~system~you~have.
BEN LOCATE 1 13 / WRITEC LIGHTCYAN BLUE Oh!~You've~got~a~%BEN%~video~system!
IF "%BEN%"=="EGA" GOTO EGAVGA
IF "%BEN%"=="VGA" GOTO EGAVGA
BEN LOCATE 1 16 / WRITEC YELLOW BLUE Too~bad~you~don't~have~an~EGA~or~a~VGA~video~system.
BEN LOCATE 1 17 / WRITEC YELLOW BLUE Otherwise,~we~can~show~you~BEN's~EGAVGA~function.
BEN LOCATE 1 22 / WRITEC LIGHTGRAY LIGHTBLUE Well,~please~press~any~key~to~return~to~the~menu~.~.~. / FLUSH / PAUSE
GOTO MainMenu
:EGAVGA
BEN BEEP LOCATE 1 16 / WRITEC YELLOW LIGHTBLUE Neat!~Press~any~key~to~switch~to~extended~line~mode~.~.~.
BEN FLUSH / PAUSE / EGAVGA ON / CLS CYAN
IF "%BEN%"=="EGA" BEN GROWFILLEDBOX 5 3 76 41 WHITE BLUE 2
IF "%BEN%"=="VGA" BEN GROWFILLEDBOX 5 3 76 48 WHITE BLUE 2
BEN LOCATE 1 20 WRITEC YELLOW BLUE ╒═════╗~╒══════╗~╒══════╗~~~~~╒═╗~╒═╗~~~~╒═╗~╒══════╗~╒══════╗
BEN LOCATE 1 21 WRITEC YELLOW BLUE │~╓───╜~│~╓────╜~│~╓──┐~║~~~~╒╛╓╜~│~║~~~~│~║~│~╓────╜~│~╓──┐~║
BEN LOCATE 1 22 WRITEC YELLOW BLUE │~╚═╗~~~│~║~╒══╗~│~╚══╛~║~~~╒╛╓╜~~└┐╚╗~~╒╛╓╜~│~║~╒══╗~│~╚══╛~║
BEN LOCATE 1 23 WRITEC YELLOW BLUE │~╓─╜~~~│~║~└┐~║~│~╓──┐~║~~╒╛╓╜~~~~└┐╚╗╒╛╓╜~~│~║~└┐~║~│~╓──┐~║
BEN LOCATE 1 24 WRITEC YELLOW BLUE │~╚═══╗~│~╚══╛~║~│~║~~│~║~╒╛╓╜~~~~~~└┐╚╛╓╜~~~│~╚══╛~║~│~║~~│~║
BEN LOCATE 1 25 WRITEC YELLOW BLUE └─────╜~└──────╜~└─╜~~└─╜~└─╜~~~~~~~~└──╜~~~~└──────╜~└─╜~~└─╜
BEN LOCATE 1 35 WRITEC WHITE BLUE Mode~is~currently~activated,~as~you~might~have~seen!
BEN LOCATE 1 40 WRITEC LIGHTMAGENTA LIGHTBLUE Press~any~key~to~return~to~25~lines~mode.
BEN FLUSH / PAUSE / EGAVGA OFF / CURSOR OFF / TITLEDBOX 1 1 80 25 WHITE RED 1 BEN~-~the~Batch~Enhancer~(c)~1992
GOTO MainMenu
:----------------------------------------------------------------------------
:CloseDown
SET NAME=
BEN CLEANUP
CLS
ECHO BENDEMO.BAT - A Demo Batch File That Demonstrates BEN
ECHO
ECHO Thank you for taking your time to evaluate our demo.
ECHO We hope that you would take a look at other files that
ECHO are included in the BEN package as well (eg. BENEDIT).
ECHO
ECHO Thanks!
ECHO