Setting command line parameters while debugging?
Moderators: Dorian (MJT support), JRL
Setting command line parameters while debugging?
I'm developing a script that will require a few parameters, but I need to run with the debugger. Is there a way to set those parameters so they'll be available for the debug session?
Re: Setting command line parameters while debugging?
When you pass a parameter all you are doing is creating a variable within the executing script. Therefore make a variable with the parameter name to use during debug.
Let>ParameterOne=A Fake Passed Value
//The rest of the script.
Just be sure you delete before actually using the script.
Let>ParameterOne=A Fake Passed Value
//The rest of the script.
Just be sure you delete before actually using the script.
- CyberCitizen
- Automation Wizard
- Posts: 721
- Joined: Sun Jun 20, 2004 7:06 am
- Location: Adelaide, South Australia
Re: Setting command line parameters while debugging?
You could create a file and use iffileexists>
Include>
And using that include script that could contain your preset variables so when the file doesn't exist it won't use them.
Or just set them at the start of the script and comment them out when Finished.
Include>
And using that include script that could contain your preset variables so when the file doesn't exist it won't use them.
Or just set them at the start of the script and comment them out when Finished.
FIREFIGHTER
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Setting command line parameters while debugging?
Either just temporariliy hard code the variables into the script for debug purposes or do something like this:
The benefit of this is that if you don't need to remember to remove anything when you "go live". The above will initialise the parameter if none was passed and will do nothing if one was provided.
Code: Select all
Assigned>PassedParameter,haveParameter
If>haveParameter=FALSE
Let>PassedParameter=debug value
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?