home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
UTILS2
/
POWERBAT.ZIP
/
INQUIRE.PWR
< prev
next >
Wrap
Text File
|
1994-01-02
|
5KB
|
188 lines
; Current color variables
Variable ForeColor,3
Variable BackColor,3
Variable Composite,3
; Current directory variables
Variable CurrDrive,1,''
Variable CurrDirectory,255
; Current date variables
Variable DayOfWeek,10
Variable Month,2
Variable Day,2
Variable Year,4
; Disk Information variables
Variable VolID,12
Variable DriveType,10
; Disk space variables
Variable TotalSpace,11
Variable FreeSpace,11
; Environment variable variables
Variable EnvironLabelName,12
Variable EnvironNameValue,255
; FileExpand variables
Variable FileName,64
; FileSize variables
Variable FileSize,11
;Time variables
Variable CurrentTime,11
; Working variables
Variable CLP%1,1
Variable Work,255
Variable InChar,1
Variable SpecChar,1
Variable Normal,1,1
Variable Off,1,2
Variable Color1,3,112
Variable Color2,3,96
Variable Color3,3,116
Variable Color4,3,30
Variable Color5,3,31
Variable Color6,3,14
Variable Color7,3,12
Variable Color8,3,95
Variable MonitorType,1
Variable PressAnyKey,25,'244Press Any Key To Exit'
; Does the user want instructions
Compare CLP%1,'?',ChkSwt,ChkSwt
Writeline ''
Writeline 'Enter INQUIRE M to force monochrome colors'
Writeline ''
Halt
Label ChkSwt
; Do we force to mono colors
Upper CLP%1
Compare CLP%1,'M',,,MonoColors
; Do we have a color monitor
SetVar MonitorType,DispAdapter
Compare MonitorType,'C',,,ColorMon
; Set the colors to show on mono screen
Label MonoColors
SetVar Color1,7
SetVar Color2,7
SetVar Color3,7
SetVar Color4,7
SetVar Color5,7
SetVar Color6,7
SetVar Color7,7
SetVar Color8,7
Label ColorMon
; Query the system for the current color defined to DOS
?Color ForeColor,BackColor,Composite
; Clear the screen to black on gray with a red border
Cursor Off
Window2 1,1,80,25,Color1 ;enable us to clear inside of box with char
Clear Color1,,'░'
Window0 1,1,80,25,Color1 ;set the window back to normal
; What is the current date
Color Color3
?Date DayOfWeek,Month,Day,Year
Concat Work,'Today is ',DayOfWeek
Concat Work,', '
Concat Work,Month
Concat Work,'/'
Concat Work,Day
Concat Work,'/'
Concat Work,Year
WriteAt 3,1,Work
; Get the current time
?Time CurrentTime
WriteAt 67,1,CurrentTime
; Display the current color
Box4 3,3,18,7,Color1,,7
WriteAt 4,3,'Current Color',Color1
Concat Work,'Foreground ',ForeColor
WriteAt 4,4,Work,Color1
Concat Work,'Background ',BackColor
WriteAt 4,5,Work,Color1
Concat Work,'Composite ',Composite
WriteAt 4,6,Work,Color1
; What is the current directory on the specified drive
Box4 21,3,77,5,Color2,,7
?CurrDir CurrDrive,CurrDirectory
Concat Work,' Current Defined Directory For Drive ',CurrDrive
Concat Work,': '
WriteAt 30,3,Work,Color2
WriteAt 22,4,CurrDirectory,Color2
; Demonstrate the check for valid directory
; Use the current directory we know is valid
?DirExist CurrDirectory,DirExists
Writeline 'This directory does not exist...' ;we dont expect this
Halt '100' ;for bad directory
Label DirExists
; What type is drive is this
Box4 3,10,30,15,Color4,,7
Concat Work,' Drive Info For ',CurrDrive
Concat Work,': '
WriteAt 7,10,Work,Color4
?DiskInfo CurrDrive,VolID,DriveType
Concat Work,'Type ',DriveType
WriteAt 4,11,Work,Color5
Concat Work,'Volume ID ',VolID
WriteAt 4,12,Work,Color5
; Check the disk space
?DiskSpac CurrDrive,TotalSpace,FreeSpace
Concat Work,'Total Space ',TotalSpace
WriteAt 4,13,Work,Color5
Concat Work,'Free Space ',FreeSpace
WriteAt 4,14,Work,Color5
; Retrieve an environment variable (PATH)
Box4 3,19,77,22,Color6,,7
WriteAt 28,19,' Environment Variables ',Color6
Color Color7
SetVar EnvironLabelName,'PATH'
?EnvStr EnvironLabelName,EnvironNameValue
WriteAt 5,20,EnvironNameValue,Color7
?EnvStr 'COMSPEC',EnvironNameValue
WriteAt 5,21,EnvironNameValue,Color7
; Find a file and report the full directory path
; Look for COMMAND.COM
Box4 33,10,77,13,Color8,,7
SetVar FileName,EnvironNameValue
Concat EnvironNameValue,' ',EnvironNameValue,' '
WriteAt 35,10,EnvironNameValue,Color8
?FileExpand FileName,FileFound
Concat Work,FileName,' not found on your system'
WriteAt 34,11,Work,Color8
GoTo FileSize
Label FileFound
WriteAt 34,11,FileName,Color8
; Check the size of a specified file. Use COMMAND.COM again
Label FileSize
?FileSize FileSize,FileName
Concat Work,'Size ',FileSize
Concat Work,' bytes...'
WriteAt 34,12,Work,Color8
Center PressAnyKey,25
Label TimeLoop
?Time CurrentTime
WriteAt 67,1,CurrentTime,Color3
ReadKey InChar,,1
Compare InChar,'',,,TimeLoop
Cursor Normal
Color Composite
Clear Composite,,,0