Code That Makes Decisions

     

A smart procedure performs tests on its environment and then decides what to do next based on the results of each test. For example, suppose you've written a Function procedure that uses one of its arguments as a divisor in a formula. You should test the argument before using it in the formula to make sure that it isn't 0 (to avoid producing a "division by zero" error). If it is, you could then display a message that alerts the user of the illegal argument.

Similarly, a well-designed application will interact with the user and ask for feedback in the form of extra information or a confirmation of a requested action. The program can then take this feedback and redirect itself accordingly .



Absolute Beginner's Guide to VBA
Absolute Beginners Guide to VBA
ISBN: 0789730766
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net