Using DEBUG with external parms

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Using DEBUG with external parms

Post by gdyvig » Fri Oct 31, 2008 3:30 pm

You may have noticed you can not pass parms into your macro when using the debugger, that is you cannot start msched.exe with both the -EDITOR option (so you can debug) and pass in parms. Of course you can temporarily create and later comment out variables, but what you would really like to do is run the macro in DEBUG mode or not without risking unintended modifications.

When you run in debug mode, MS creates a SCRIPT_FILE ...\__debug.dbg. So put this in your script:

Position>\__debug.dbg,%SCRIPT_FILE%,1,nDebug,TRUE
if>%nDebug%>0
Let>myparm1=myparm1value
//or put in a parm dialog
//or load parms with an include statement.
endif

The code in the if block is executed only when running in debug mode.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts