|
|
Title | Let a routine take optional parameters without a default value |
Keywords | optional, optional parameters |
Categories | Tips and Tricks, Software Engineering |
|
|
Use the Optional keyword. If you make the optional parameters Variants, you can use IsMissing to see which ones are missing and take special action.
|
|
Private Sub Draw(Optional X As Variant, Optional Y As _
Variant)
If IsMissing(X) Then X = 720
If IsMissing(Y) Then Y = 2880
Cls
Circle (X, Y), 700
End Sub
|
|
|
|
|
|