home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / n_calc / ncalc.frm (.txt) next >
Visual Basic Form  |  1992-03-26  |  9KB  |  177 lines

  1. Calculator
  2. Calculator
  3. System
  4. Form1
  5. Readout
  6. Number
  7. System
  8. Number
  9. System
  10. Number
  11. System
  12. Cancel
  13. System
  14. CancelEntry
  15. System
  16. Number
  17. System
  18. Number
  19. System
  20. Number
  21. System
  22. Operator
  23. System
  24. Operator
  25. System
  26. Number
  27. System
  28. Number
  29. System
  30. Number
  31. System
  32. Operator
  33. System
  34. Operator
  35. System
  36. Number
  37. System
  38. Decimal
  39. System
  40. Operator
  41. System
  42. Percent
  43. System
  44. DecimalFlagw
  45. NumOps-
  46.     LastInput
  47. OpFlag
  48. FALSEH
  49. @    Form_Load
  50. Percent_Click
  51. Readout
  52. Caption
  53. Cancel_Click
  54. Decimal_Click,
  55. CancelEntry_Click
  56. Number_Click
  57. Index
  58. Number
  59. Operator_Click
  60. Operator
  61. Readout_Clickc
  62. Readout_Change5
  63. Number_KeyPress
  64. KeyAscii
  65. Number_KeyDownS
  66. KeyCode
  67. Shift
  68. command1
  69. getfocus
  70. sendmessage
  71. BM_SETSTATE
  72. LastKey
  73.     lastindexA
  74. ProcessKeyDown
  75. lasttype
  76. GoodKeys
  77. Number_KeyUp4
  78. ProcessKeyUp
  79. KeyState
  80. KEY_NUMPAD0
  81. KEY_NUMPAD9Y
  82. Operator_KeyDown
  83. Operator_KeyUp{
  84. KEY_NUMPAD
  85. KEY_RETURN
  86. Percent_KeyDown
  87. Decimal_KeyDown
  88. Cancel_KeyDown
  89. CancelEntry_KeyDownD
  90. Cancel_KeyUp
  91. CancelEntry_KeyUp
  92. Decimal_KeyUp
  93. Percent_KeyUp
  94. KEY_ADD
  95. KEY_SUBTRACT
  96. KEY_MULTIPLY
  97. KEY_DIVIDE
  98. KEY_DECIMAL
  99. Decimal
  100. Percent
  101. Clear_Click
  102. Cancel
  103. CancelEntry
  104.  Copyright (C) 1991 Microsoft Corporation-
  105.  You have a royalty-free right to use, modify, reproduce and distribute-
  106.  the Sample Application Files (and/or any modified version) in any way
  107.  you find useful, provided that you agree that Microsoft has no warranty,
  108.  obligations or liability for any Sample Application Files.s
  109.  Modifications & Enhancements by Marcus Smaby - these modificationss
  110.  & enhancements released to the public domainn
  111.  Previously input operand.
  112.  Second operand.
  113.  Decimal point present yet?
  114.  Number of operands.
  115.  Indicate type of last keypress.
  116.  Indicate pending operation.
  117.  Handle to Control
  118.  Was this a key we can process
  119.  Remember state of Key to prevent repeat
  120.  scan code of last key
  121. Form_Load
  122.  Initialization routine for the form.t
  123.  Set all variables to initial values.t
  124. Percent_Click
  125.  Click event procedure for percent key (%).
  126.  Compute and display a percentage of the first operand.-
  127. Cancel_Click
  128.  Click event procedure for C (cancel) key.
  129.  Reset the display and initializes variables.t
  130. Decimal_Click
  131.  Click event procedure for decimal point (.) key.e
  132.  If last keypress was an operator, initializek
  133.  readout to "0." Otherwise, append a decimal
  134.  point to the display.
  135. CancelEntry_Click
  136.  Click event procedure for CE (cancel entry) key.e
  137. Number_Click
  138.  Click event procedure for number keys (0-9).k
  139.  Appends new number to the number in the display.e
  140. Operator_Click
  141.  Click event procedure for operator keys (+, -, x, /, =).
  142.  If the immediately preceeding keypress was part of a 
  143.  number, increment NumOps. If one operand is present, 
  144.  set Op1. If two are present, set Op1 equal to the
  145.  result of the operation on Op1 and the currentt
  146.  input string, and display the result.
  147. Can't divide by zero
  148. Calculator
  149. Number_KeyDown
  150. ProcessKeyDown
  151.  Key Table
  152.    + = 43, - = 45, / = 47 * = 42
  153.    % = 37, = = 61, c = 99,67, . = 46
  154.  Avoid Auto Repeat
  155.  classify keystroke & act 
  156.  Debug.Print lastkey
  157.  0 - 9
  158.  p for percent
  159.  C for Cancels
  160.  <- or del for CancelEntry
  161. Get the Handle
  162.  Set control as pressed0
  163. Number_KeyUp
  164. ProcessKeyUp
  165.  set control as unpressed
  166.  Set Focus to Equals Key
  167. Operator_KeyDown
  168. Operator_KeyUp
  169. Percent_KeyDown
  170. Decimal_KeyDown
  171. Cancel_KeyDown
  172. CancelEntry_KeyDown
  173. Cancel_KeyUp
  174. CancelEntry_KeyUp
  175. Decimal_KeyUp
  176. Percent_KeyUp
  177.