Jump to content

Recommended Posts

Posted

I am building a debug function into my script, I only want this function to be called, if $debug = True..

So my question:

do I an If Then statement like:

If $debug = True Then debug('stuff')

func debug($para1)

msgbox(0,'',$para1)

Endfunc

or do I call the function everytime like and return if $debug is not True

debug('stuff')

func debug($para1)

If Not $debug Then Return

msgbox(0,'',$para1)

Endfunc

So my only concern would be performance.. if I am debugging, it could be called 1000s of times and it will not be calling a msgbox, it will logging to a file..

So which would better or does it not really matter?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...