Section 4.3. Constants


4.3. Constants

Constants are essentially read-only variables. Once their value is set in code (at compile time), they cannot change. Constants are defined at the local or module level using the Const keyword:

     accessModifier Const name As type = value 

where accessModifier is one of the access modifiers defined earlier. (Access modifiers are not used for constants declared in procedures.) When Option Strict is On, all constant declarations must have a declared type.




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net