dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic Classic (6 and earlier)
Expertise: Advanced
Sep 7, 2016

Runtime Mode

If you ever need to know whether your code running inside the IDE or is compiled, drop these two functions in a module and use the first one to figure it out:

Public Function RunTimeMode() As Boolean
Dim bool As Boolean
    Debug.Assert SetToTrue(bool)
    RunTimeMode = Not bool
End Function

Private Function SetToTrue(ByRef bool As Boolean) As Boolean
    bool = True
    SetToTrue = True
End Function

Oracy
 
Thanks for your registration, follow us on our social networks to keep up-to-date