Defines conditional compiler constants for Visual Basic.
#Const constname = expression
Conditional compiler constants are always private to the file in which they appear. You cannot create public compiler constants using the #Const directive; you can create them only in the user interface.
You can use only conditional compiler constants and literals in expression. Using a standard constant defined with #Const causes an error. Conversely, you can use constants defined with the #Const keyword only for conditional compilation. Constants also can be undefined, in which case they have a value of Nothing.
This example uses the #Const directive.
#Const
MyCountry = "USA"#Const
Version = "8.0.0012"#Const
CustomerNumber = 36
#If...Then...#Else Directives | Const Statement |