Debug Mode In VB 6?

前端 未结 4 1007
南方客
南方客 2021-02-18 13:33

How can I do something similar to the following C code in VB 6?

#ifdef _DEBUG_
    // do things
#else
    // do other things
#end if
4条回答
  •  长情又很酷
    2021-02-18 13:35

    This is my short and stable code. I think it is better than conditional constants, because you don't need to change it every complication time.

    Public Function InIDE() As Boolean
      On Error Resume Next
      Debug.Print 0 / 0
      InIDE = Err.Number <> 0
    End Function
    

提交回复
热议问题