Use #If : Compiler Directive « Language Basics « VBA / Excel / Access / Word






Use #If

 

#Const Debugging = True

Public Sub Trap(ByVal Source As String, ByVal Message As String)
    #If Debugging Then
      Call DebugPrint(Source, Message)
      Stop
    #End If
End Sub

 








Related examples in the same category

1.Use string text value as the compiler directive
2.With the compiler directive
3.Use #Const to define the constant