June 2002
Intermediate to advanced
864 pages
18h 35m
English
VB.NET allows parameters to be defined as optional. That is, the calling statement may or may not pass a value for that parameter. If optional parameters are defined, a default value for them must be specified. When arguments are passed, the actual argument is used. When no argument is passed, the default value for the parameter is used.
To define a parameter as optional, the keyword Optional is used. The default value for the parameter is specified using the assignment operator and a value after the declaration. The example OptionalParameters illustrates the use of these parameters.
' Calculates shipping costs; assumes that the Rapid Express ' is the default shipper. Shipper codes are: ' 1=Rapid Express, 2=Quick Shippers, ...
Read now
Unlock full access