Type Conversion Functions

To find out more about the CSng function (and other type conversion functions), position the insertion point anywhere within the word CSng and press F1.

The next instruction, allPurchase = allPurchase + purchCost, adds the new value supplied by the InputBox function to the current purchase value. When you run this procedure for the first time, the content of the allPurchase variable is the same as the content of the purchCost variable. When you run the procedure the second time, the value of the static variable is increased by the new value entered in the dialog box. You can run the CostOfPurch procedure as many times as you want. The allPurch variable will keep the running total for as long as the project is open.

To try out the CostOfPurchase procedure shown above, follow these steps:

0 0

Post a comment