home *** CD-ROM | disk | FTP | other *** search
- Variable Fore,1 ;save ares for initial colors
- Variable Back,1
- Variable ColorAttr,1
- Variable CharIn,1 ;for user responses
- Variable RedOnGray,3,116
- Variable RedOnBlack,3,4
- Variable YelOnBlue,3,30
- Variable YelOnGray,3,126
- Variable BlueOnGray,3,113
- Variable DOW,9 ;for date command
- Variable Mo,2
- Variable Da,2
- Variable Yr,4
- Variable CurrTime,11 ;for current time
- Variable DirName,78 ;for user entered directory name
- Variable FileName,78 ;for user entered file name
- Variable Space35,35," "
- Variable Space76,76," "
- Variable TotSpace,10
- Variable AvailSpace,10
- Variable Msg,78
- Variable Msg2,78
- Variable FName,35
- Variable LName,35
- ?Color Fore,Back,ColorAttr ;initial color
- ?Date DOW,Mo,Da,Yr ;get system date
- ?Time CurrTime ;get system time
- Clear
- ReadYN "Do you have a color monitor? [Y/N] ",CharIn
- Compare CharIn,"Y",,,ColorMon
- SetVar RedOnGray,112
- SetVar YelOnBlue,7
- SetVar BlueOnGray,7
- Label ColorMon
- Clear BlueOnGray ;clear to my color
- Box1 2,10,79,25,YelOnBlue ;info box border
- ClearBox 2,10,79,25,YelOnBlue ; interior
- Color RedOnGray
- Box3 24,1,56,5,RedOnBlack ;title box
- ClearBox 24,1,56,5,RedOnBlack
- Color RedOnBlack
- Center "POWERBATCH",2
- Center "By",3
- Center "Computing Systems Design, Inc.",4
- Color YelOnBlue
- WriteAt 3,11,"PowerBatch is a power batch utility that produces COMPILED batch files."
- WriteAt 3,12,"With PowerBatch you can perform all standard DOS batch functions, plus"
- WriteAt 3,13,"use the 35 additional PowerBatch commands to create batch files with POWER."
- WriteAt 3,15,"PowerBatch compiles your batch commands and produces a standalone .EXE"
- WriteAt 3,16,"module that executes at the top speed of your computer. This information"
- WriteAt 3,17,"and demonstration program you are now running is a compiled PowerBatch"
- WriteAt 3,18,"program (the included source is DEMO1.PWR). PowerBatch is especially"
- WriteAt 3,19,"powerful for screen related functions. Draw boxes, write to the screen with"
- WriteAt 3,20,"blazing speed, control text colors with ease, get input from the user, make"
- WriteAt 3,21,"data comparisions and logic branches, and access system information with"
- WriteAt 3,22,"single commands. Follow this tour of the power in PowerBatch."
- GoToXY 26,24
- Write "Press any key to continue...",RedOnGray
- ReadKey CharIn
- Box3 2,10,79,25,YelOnBlue ;info box border
- ClearBox 2,10,79,25,YelOnBlue
- WriteAt 3,11,"PowerBatch gives you access to the system date and time and makes these"
- WriteAt 3,12,"available as variables for your use in screen writes."
- WriteAt 3,14,"The system date is returned in four variables of your choice. In these"
- GoToXY 3,15
- Write "variables are placed Day of the week ("
- Write DOW
- Write ") Month number ("
- Write Mo
- Write "),"
- GoToXY 3,16
- Write "Day number ("
- Write Da
- Write "), and Year number ("
- Write Yr
- Write ")."
- WriteAt 3,18,"In a like manner the current time may be retrieved into a variable of your"
- WriteAt 3,19,"choice, and used any way you wish."
- WriteAt 3,21,"Current time is "
- WriteAt 19,21,CurrTime
- GoToXY 26,24
- Color YelOnBlue
- Blink
- Write "Press any key to continue..."
- Normal
- ReadKey CharIn
- Box2 2,10,79,25,YelOnGray ;info box border
- ClearBox 2,10,79,25,YelOnBlue
- WriteAt 3,11,"PowerBatch also provides you with several input commands to retrieve both"
- WriteAt 3,12,"data and question responses from the user. Commands are provided to retrieve"
- WriteAt 3,13,"one key (and one key only), read one key in upper case, read either Y or N"
- WriteAt 3,14,"for Yes/No responses, and to read a string of a specified length."
- GoToXY 3,15
- Write "Enter one character in lower case [ ]"
- GoToXY 38,15
- ReadKey CharIn
- GoToXY 41,15
- Write "You can manipulate the case "
- GoToXY 3,16
- Write "of the data entered changing from lower ["
- Write CharIn
- Write "] to upper ["
- Upper CharIn
- Write CharIn
- Write "] to lower ["
- Lower CharIn
- Write CharIn
- Write "]."
- WriteAt 3,18,"PowerBatch also contains strong string manipulation commands."
- WriteAt 3,19,"Enter your last name "
- ReadStr LName
- WriteAt 14,19,Space35
- WriteAt 14,19,"first name "
- ReadStr FName
- WriteAt 3,19,Space35
- Midstring Msg,FName,1,3
- Midstring Msg2,LName,1,3
- Concat Msg," "
- Concat Msg,Msg2
- WriteAt 3,20,Msg
- Wait 10
- Midstring Msg,FName,1,6
- Midstring Msg2,LName,1,6
- Concat Msg," "
- Concat Msg,Msg2
- WriteAt 3,20,Msg
- Wait 10
- Concat Msg,FName," "
- Concat Msg,LName
- WriteAt 3,20,Msg
- Length Msg2,Msg
- Concat Msg,"The length of this name field is ",Msg2
- WriteAt 3,21,Msg
- GoToXY 26,24
- Write "Press any key to continue...",RedOnGray
- ReadKey CharIn
- ClearBox 2,10,79,25,YelOnBlue
- WriteAt 3,11,"PowerBatch gives you the capability to verify drives, directories, or file"
- WriteAt 3,12,"names entered by the user. You may execute selected portions of the batch"
- WriteAt 3,13,"file based on the existance or non-existance of these entries."
- Label ChekDrive
- GoToXY 3,15
- Write "Enter a drive letter to be verified"
- Write Space35
- GoToXY 39,15
- ReadUpKey CharIn
- ?DriveExist CharIn,GoodDrive
- Blink
- WriteAt 3,24,"That is not a valid drive in your system. Please re-enter."
- Normal
- Beep 750,8
- Wait 30
- WriteAt 3,24,Space76
- GoTo ChekDrive
- Label GoodDrive
- GoToXY 3,16
- Write "Enter a directory name to be verified"
- Write Space35
- GoToXY 41,16
- ReadStr DirName
- ?DirExist DirName,GoodDir
- Blink
- WriteAt 3,24,"That is not a valid directory in your system. Please re-enter."
- Normal
- Wait 30
- WriteAt 3,24,Space76
- GoTo GoodDrive
- Label GoodDir
- GoToXY 3,17
- Write "Enter a file name to be verified"
- Write Space35
- GoToXY 36,17
- ReadStr FileName
- ?FileExist FileName,GoodFile
- Blink
- WriteAt 3,24,"That is not a valid filename in your system. Please re-enter."
- Normal
- Wait 30
- WriteAt 3,24,Space76
- GoTo GoodDir
- Label GoodFile
- WriteAt 3,18,"PowerBatch can query your disk for total space and available space"
- WriteAt 3,19,"Drive [ ] capacities are (enter drive letter)"
- GoToXy 10,19
- ReadUpKey CharIn
- ?DiskSpace CharIn,TotSpace,AvailSpace
- Concat Msg,CharIn," has "
- Concat Msg,AvailSpace
- Concat Msg," bytes available of the total "
- Concat Msg,TotSpace
- Concat Msg," bytes"
- WriteAt 9,19,Msg
- GoToXY 26,24
- Write "Press any key to continue...",RedOnGray
- ReadKey CharIn
- Clear
- WriteLine "PowerBatch can run any valid DOS command that may be inserted in a batch file."
- WriteLine "For example, here is a listing of your current directory..."
- Wait 30
- Clear ColorAttr ;clear to default color
- Dir "/w"
- Wait 30
- Color YelOnBlue
- Clear
- WriteLine "PowerBatch can also run (and return) other PowerBatch programs, giving you a "
- WriteLine "subroutine capability. It has the capability to re-boot the system (which I"
- WriteLine "will NOT demonstrate here."
- GoToXY 1,5
- WriteLine "The purpose of this demonstration is to not only show you the capabilities"
- WriteLine "of PowerBatch, but to let you compare the source with the running version"
- WriteLine "of this program and aid you in the development of your own PowerBatch"
- WriteLine "programs."
- GoToXY 1,10
- Write "Press any key to continue..."
- ReadKey CharIn
- Color ColorAttr ;reset original colors
- Clear
- Box3 24,1,56,5,ColorAttr
- Center "POWERBATCH",2
- Center "By",3
- Center "Computing Systems Design, Inc.",4
- GoToXy 1,24
-