Programming » Visual Basic 6 » Visual Basic 6 Code » Application » ");?>
The trick here is that within the IDE, the Debug statement will cause an error detected by Err.Number, in release mode, the Debug statement will not be executed, hence no error.
Private Function InIDE() As Boolean
    '========================================
    ' Source: microsoft.public.vb.general.discussion
    ' Author: Nikolaus Seydel
    '========================================
    On Error Resume Next
    Debug.Print 1 / 0
    InIDE = (Err.Number <> 0)
End Function