p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Visual Basic 2008 ISBN: 978-0-470-19136-1 (http://p2p.wrox.com/forumdisplay.php?f=405)
-   -   Page 36 errata (http://p2p.wrox.com/showthread.php?t=71955)

Patrick Cambria December 24th, 2008 09:13 AM

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."

Code:

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.[:confused:]


All times are GMT -4. The time now is 06:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.