Thread: Page 36 errata
View Single Post
Old December 24th, 2008, 09:13 AM
Patrick Cambria Patrick Cambria is offline
Authorized User
Join Date: Dec 2008
Location: Keyport, NJ 07735
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs down Page 36 errata

"In addition to mandatory parameters, which must be passed with a call to a given function, it is possible to declare optional paramaters. Optional parameters can be omitted by the calling code. This way, it is possible to call a method such as RedRight, passing either a single parameter defining the length of the string and using the default of space for the padding character, or with two parameters, the first still defining the lenght of the string but the secon now replacing the default of space with a dash."

Public Function PadRight(ByVal intSize as Integer, _
            Optional ByVal chrPad as Char = " "c)
End Function
The optional parameter in the can be any value of type char not just a dash, and no where in the examples is a dash passed as a parameter.
Need free one on one help getting started with Visual Basic? Contact me via its free.