Runtime Mode

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


About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist