home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
diags
/
pandor23.zip
/
HC.PAN
< prev
next >
Wrap
Text File
|
1991-09-18
|
4KB
|
182 lines
*********************************************************
*** ***
*** Pandora Front-End for Neil Rubenking's HugeCalc ***
*** ***
*********************************************************
* This script requires HC.EXE, Neil Rubenking's PC Magazine Utility HugeCalc.
* If you don't have HugeCalc then please download HC.ZIP from ZiffNet's
* Utilities Forum library 2.
IfExist "hc.exe"
Else
Output "^G^M^JERROR: Cannot locate the executable file for HugeCalc (HC.EXE)"
Quit
EndIf
IfExist "accumula.hc"
Else
Output "0" > accumula.hc
EndIf
Wipe
* Display the accumulator value
Label Display
VideoFore Yellow
VideoBack Magenta
BlankLine 0 3
VideoFore White
VideoBack Black
BlankLine 4 6
VideoFore Yellow
VideoBack Magenta
Output "@echo off^M^Jhc + 0 <accumula.hc^M^J" >$pan$.bat
Cursor 0 0
DOS "$pan$"
Cursor 25 0
* Display functions
Screen 8 10 "╔══╡ Functions: ╞═════════════╗"
Screen 9 10 "║ ║"
Screen 10 10 "║ C Clear accumulator ║"
Screen 11 10 "║ L Load accumulator ║"
Screen 12 10 "║ S Store accumulator ║"
Screen 13 10 "║ + Add ║"
Screen 14 10 "║ - Subtract ║"
Screen 15 10 "║ * Multiply ║"
Screen 16 10 "║ / Divide ║"
Screen 17 10 "║ ^^ Power (exponent) ║"
Screen 18 10 "║ ! Factorial ║"
Screen 19 10 "║ X Exit ║"
Screen 20 10 "║ ║"
Screen 21 10 "╚═════════════════════════════╝"
* Get a function
Label function
GetKey
IfKey "CcLlSsXx+-*/!^^[Esc]"
IfKey "Cc"
Output "0" > accumula.hc
Jump Display
EndIf
IfKey "Xx[Esc]"
DOS "del $*.hc"
Cursor 23 0
Quit
EndIf
IfKey "Ll"
Load "keyfile.com"
Cursor 0 0
BlankLine 0 3
Output "Enter accumulator value: "
Lock
Go "accumula.hc"
OnDeath loaded
Label loader
WaitKey
IfKey "0123456789[Enter]"
PassKey
EndIf
Jump loader
Label loaded
Unlock
Jump Display
EndIf
IfKey "Ss
Load "keyfile.com"
Cursor 5 0
BlankLine 5
Output "Enter filename: "
Go "$fn$.hc"
WaitChild
Cursor 25 0
Output "@echo off^M^Jcopy accumula.hc " > $hc$.hc
Output "@echo off^M^Jcopy /b $hc$.hc+$fn$.hc $pan$.bat >nul^M^J" > $hc$.bat
DOS "$hc$"
Output " >nul^M^J" >> $pan$.bat
DOS "$pan$"
Screen 5 0 "Saved to file: "
Jump function
EndIf
IfKey "+-*/!^^"
Screen 4 0 "Operator: "
Output "@echo off^M^Jhc " > $hc$.hc
EndIf
IfKey "+"
Screen 4 10 "+"
Output "+ " >> $hc$.hc
Jump GetOperand
EndIf
IfKey "-"
Screen 4 10 "-"
Output "- " >> $hc$.hc
Jump GetOperand
EndIf
IfKey "*"
Screen 4 10 "*"
Output "* " >> $hc$.hc
Jump GetOperand
EndIf
IfKey "/"
Screen 4 10 "/"
Output "/ " >> $hc$.hc
Jump GetOperand
EndIf
IfKey "^^"
Screen 4 10 "^^"
Output "^^ " >> $hc$.hc
Jump GetOperand
EndIf
IfKey "!"
Screen 4 10 "!"
Output "@echo off^M^Jhc ! " > $hc$.bat
Jump RunBatch
EndIf
Else
Output "^G"
EndIf
Jump function
* Read an operand
Label GetOperand
Load "keyfile.com"
Cursor 5 0
BlankLine 5 6
NumLock On
Output "Enter operand: "
Lock
Go "$op$.hc"
OnDeath gotop
Label getop
WaitKey
IfKey "[Enter]0123456789"
PassKey
EndIf
Jump getop
Label gotop
Unlock
* Copy the operand to the batch file
Cursor 25 0
Output "@echo off^M^Jcopy /b $hc$.hc+$op$.hc $hc$.bat >nul^M^J" > $pan$.bat
DOS "$pan$"
* Append the input file and run the batch file
Label RunBatch
Output " <accumula.hc" >> $hc$.bat
Output " >$newacc$.hc^M^J" >> $hc$.bat
Output "copy $newacc$.hc accumula.hc >nul^M^J" >> $hc$.bat
Screen 24 0 "Working..."
DOS "$hc$"
VideoFore White
VideoBack Black
BlankLine 24
VideoFore Yellow
VideoBack Magenta
Jump Display