I think there's a way to perfom something if you're debugging or not. I thought it was sth. like:However, this doesn't work. What's the way to do this?VB Code:
#If Debug Then 'Code here #End If
Printable View
I think there's a way to perfom something if you're debugging or not. I thought it was sth. like:However, this doesn't work. What's the way to do this?VB Code:
#If Debug Then 'Code here #End If
What do you mean "it doesn't work"? Debug is an IDE object, so that may be your problem.
Thanks, I know that. What's the proper way to do this?
VB Code:
#If DEBUGGING Then 'Code here #End If
Should be fine. Then define a conditional const called DEBUGGING in either the project properties, or at the top of the code module.
VB Code:
#Const DEBUGGING = True
Ok, but doesn't that mean the I should turn the Const to False just before compiling?
Yup
Thought so! I was looking for an automatic way. Thanks!
Another way to accomplish the same thing is to go to Project|Properties|Make and put something like DEBUGGING = 1 in the Conditional Compilation Arguments: box. To turn off any conditional statements simply change the argument to DEBUGGING = 0.