Option Explicit
Public TESTING As Boolean
#Const TESTING = True 'Set true or false as required
Sub TestingCheck()
'Dummy procedure which is never called.
#If TESTING Then
Will not compile if TESTING is true
'The above line appears red in the VB6 code editor.
'That's expected because we are forcing a compile error. Don't edit it!
#End If
End Sub
Public Sub Main()
'Set a public variable so we can check it from
'anywhere in the program. (The compiler constant
'with the same name applies ONLY in the module
'in which it is declared.
#If TESTING Then
TESTING = True
#End If
'Example of use >>>>>>>>>>>>>>>>>>>
'Dim DataFromSpacecraft As String
'If TESTING Then
'
' 'Supply dummy data for testing the application
' DataFromSpacecraft = "Hello earth!"
'
'Else
'
' 'Get real data
' DataFromSpacecraft = GetDataFromSpacecraft()
'
'End If
'Example of use >>>>>>>>>>>>>>>>>>>
End Sub