home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / diags / pandor23.zip / HC.PAN < prev    next >
Text File  |  1991-09-18  |  4KB  |  182 lines

  1.       *********************************************************
  2.       ***                                                   ***
  3.       ***  Pandora Front-End for Neil Rubenking's HugeCalc  ***
  4.       ***                                                   ***
  5.       *********************************************************
  6.  
  7. * This script requires HC.EXE, Neil Rubenking's PC Magazine Utility HugeCalc.
  8. * If you don't have HugeCalc then please download HC.ZIP from ZiffNet's
  9. * Utilities Forum library 2.
  10.  
  11. IfExist "hc.exe"
  12. Else
  13.     Output "^G^M^JERROR:  Cannot locate the executable file for HugeCalc (HC.EXE)"
  14.     Quit
  15. EndIf
  16. IfExist "accumula.hc"
  17. Else
  18.     Output "0" > accumula.hc
  19. EndIf
  20. Wipe
  21.  
  22. * Display the accumulator value
  23.  
  24. Label Display
  25. VideoFore Yellow
  26. VideoBack Magenta
  27. BlankLine 0 3
  28. VideoFore White
  29. VideoBack Black
  30. BlankLine 4 6
  31. VideoFore Yellow
  32. VideoBack Magenta
  33. Output "@echo off^M^Jhc + 0 <accumula.hc^M^J" >$pan$.bat
  34. Cursor 0 0
  35. DOS "$pan$"
  36. Cursor 25 0
  37.  
  38. * Display functions
  39.  
  40. Screen  8 10 "╔══╡ Functions: ╞═════════════╗"
  41. Screen  9 10 "║                             ║"
  42. Screen 10 10 "║      C  Clear accumulator   ║"
  43. Screen 11 10 "║      L  Load accumulator    ║"
  44. Screen 12 10 "║      S  Store accumulator   ║"
  45. Screen 13 10 "║      +  Add                 ║"
  46. Screen 14 10 "║      -  Subtract            ║"
  47. Screen 15 10 "║      *  Multiply            ║"
  48. Screen 16 10 "║      /  Divide              ║"
  49. Screen 17 10 "║      ^^  Power (exponent)    ║"
  50. Screen 18 10 "║      !  Factorial           ║"
  51. Screen 19 10 "║      X  Exit                ║"
  52. Screen 20 10 "║                             ║"
  53. Screen 21 10 "╚═════════════════════════════╝"
  54.  
  55. * Get a function
  56.  
  57. Label function
  58. GetKey
  59. IfKey "CcLlSsXx+-*/!^^[Esc]"
  60.     IfKey "Cc"
  61.         Output "0" > accumula.hc
  62.         Jump Display
  63.     EndIf
  64.     IfKey "Xx[Esc]"
  65.         DOS "del $*.hc"
  66.         Cursor 23 0
  67.         Quit
  68.     EndIf
  69.     IfKey "Ll"
  70.         Load "keyfile.com"
  71.         Cursor 0 0
  72.         BlankLine 0 3
  73.         Output "Enter accumulator value: "
  74.         Lock
  75.         Go "accumula.hc"
  76.         OnDeath loaded
  77.         Label loader
  78.         WaitKey
  79.         IfKey "0123456789[Enter]"
  80.             PassKey
  81.         EndIf
  82.         Jump loader
  83.         Label loaded
  84.         Unlock
  85.         Jump Display
  86.     EndIf
  87.     IfKey "Ss
  88.         Load "keyfile.com"
  89.         Cursor 5 0
  90.         BlankLine 5
  91.         Output "Enter filename: "
  92.         Go "$fn$.hc"
  93.         WaitChild
  94.         Cursor 25 0
  95.         Output "@echo off^M^Jcopy accumula.hc " > $hc$.hc
  96.         Output "@echo off^M^Jcopy /b $hc$.hc+$fn$.hc $pan$.bat >nul^M^J" > $hc$.bat
  97.         DOS "$hc$"
  98.         Output " >nul^M^J" >> $pan$.bat
  99.         DOS "$pan$"
  100.         Screen 5 0 "Saved to file:  "
  101.         Jump function
  102.     EndIf
  103.     IfKey "+-*/!^^"
  104.         Screen 4 0 "Operator:                                                                       "
  105.         Output "@echo off^M^Jhc " > $hc$.hc
  106.     EndIf
  107.     IfKey "+"
  108.         Screen 4 10 "+"
  109.         Output "+ " >> $hc$.hc
  110.         Jump GetOperand
  111.     EndIf
  112.     IfKey "-"
  113.         Screen 4 10 "-"
  114.         Output "- " >> $hc$.hc
  115.         Jump GetOperand
  116.     EndIf
  117.     IfKey "*"
  118.         Screen 4 10 "*"
  119.         Output "* " >> $hc$.hc
  120.         Jump GetOperand
  121.     EndIf
  122.     IfKey "/"
  123.         Screen 4 10 "/"
  124.         Output "/ " >> $hc$.hc
  125.         Jump GetOperand
  126.     EndIf
  127.     IfKey "^^"
  128.         Screen 4 10 "^^"
  129.         Output "^^ " >> $hc$.hc
  130.         Jump GetOperand
  131.     EndIf
  132.     IfKey "!"
  133.         Screen 4 10 "!"
  134.         Output "@echo off^M^Jhc ! " > $hc$.bat
  135.         Jump RunBatch
  136.     EndIf
  137. Else
  138.     Output "^G"
  139. EndIf
  140. Jump function
  141.  
  142. * Read an operand
  143.  
  144. Label GetOperand
  145. Load "keyfile.com"
  146. Cursor 5 0
  147. BlankLine 5 6
  148. NumLock On
  149. Output "Enter operand: "
  150. Lock
  151. Go "$op$.hc"
  152. OnDeath gotop
  153. Label getop
  154. WaitKey
  155. IfKey "[Enter]0123456789"
  156.     PassKey
  157. EndIf
  158. Jump getop
  159. Label gotop
  160. Unlock
  161.  
  162. * Copy the operand to the batch file
  163.  
  164. Cursor 25 0
  165. Output "@echo off^M^Jcopy /b $hc$.hc+$op$.hc $hc$.bat >nul^M^J" > $pan$.bat
  166. DOS "$pan$"
  167.  
  168. * Append the input file and run the batch file
  169.  
  170. Label RunBatch
  171. Output " <accumula.hc" >> $hc$.bat
  172. Output " >$newacc$.hc^M^J"  >> $hc$.bat
  173. Output "copy $newacc$.hc accumula.hc >nul^M^J" >> $hc$.bat
  174. Screen 24 0 "Working..."
  175. DOS "$hc$"
  176. VideoFore White
  177. VideoBack Black
  178. BlankLine 24
  179. VideoFore Yellow
  180. VideoBack Magenta
  181. Jump Display
  182.