home *** CD-ROM | disk | FTP | other *** search
/ Lion Share / lionsharecd.iso / dos_misc / qcalc113.zip / SAMPLE.QC < prev    next >
Text File  |  1991-10-30  |  1KB  |  64 lines

  1.  
  2. ;
  3. ; SAMPLE.QC
  4. ;
  5. ; This is a sample file for QCALC.  To use, type QCALC @SAMPLE.VAR
  6. ;
  7.  
  8. #
  9. #                           Script:  SAMPLE.QC
  10. #
  11. # An application:  What to tell the boss?  (Hit a key, or ESC to abort.)
  12.  
  13. ~ ; Pause
  14. #
  15. # 1) Turn on financial printing.  This tells QCALC to print numbers
  16. #    with a dollar sign, commas, and two decimal places.
  17.  
  18. ~
  19. #
  20. #/F
  21. /f ; Turns on Financial Printing
  22.  
  23. ~
  24. #
  25. # 2) Create two variables.  AMOUNT will store actual spending, and
  26. #    LIMIT will store the budget.
  27.  
  28.  
  29. ~
  30. #
  31. #                     The boss says, never go over $10,000 ...
  32. limit:10000              ; Defines a second variable
  33.  
  34.  
  35. ~
  36. #
  37. #                             However, you have spent ... (enter amount)
  38. !amount  ;  Input amount, and place in variable amount
  39.  
  40.  
  41. #
  42. # 3) Now, if our spending is greater than our budget, then tell the boss
  43. #    we've met the budget.  Otherwise, tell the boss the true amount.
  44.  
  45. ~
  46. #
  47. if(amount>limit,limit,amount) ; Calculate which is greater
  48.  
  49. ~
  50. #
  51. # 4) Gee, I hope we're not over budget.  If we are, the boss
  52. #    will look for some ways to cut costs (you).  And if we
  53. #    aren't, the boss won't believe you and you'll get the
  54. #    can that way.  Either way, thanks to QCALC, you're fired!
  55. #
  56. #    Will wonders never cease?
  57. #
  58.  
  59. ~
  60. # Here's how to do it without a script ... type:
  61. #
  62. #   QCALC /f amount:12852.29 limit:10000 if(gt(amount,limit),limit,amount)
  63.  
  64.