Using the IsMissing Function

The IsMissing function called from within Hands-On 4-6 allows you to determine whether or not the optional argument was supplied. This function returns the logical value of True if the third argument is not supplied, and returns False when the third argument is given. The IsMissing function is used here with the decision-making statement If.. .Then (discussed in Chapter 5). If the num3 argument is missing (IsMissing), then (Then) Visual Basic supplies a zero (0) for the value of the third argument (num3 = 0), and reduces the value stored in the argument totalNums by 1 (totalNums = totalNums - 1).

0 0

Post a comment