You declare a conditional compiler constant in code with the #Const directive, and you denote blocks of code to be conditionally compiled with the #If...Then...#Else directive. For example, to create French and German language versions of the same application from the same source code, you embed platform-specific code segments in #If...Then statements using the predefined constants FrenchVersion and GermanVersion. The following example demonstrates how:
' <code specific to the French language version>.
#ElseIf GermanVersion Then
' <code specific to the German language version>.
#Else
' <code specific to other versions>.
#End If
If you set the value of the FrenchVersion constant to True at compile time, the conditional code for the French version is compiled. If you set the value of the GermanVersion constant to True, the compiler uses the German version. If neither is set to True, the code in the last Else block runs.
Note Autocompletion will not function when editing code and using conditional compilation directives if the code is not part of the current branch.

Comments
Join the conversation! Your thoughts help the community grow.