Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleLet a routine take optional parameters without a default value
Keywordsoptional, optional parameters
CategoriesTips 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated