Debugger: how to easily simulate Args line of passed parameters?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Massi
Newbie
Posts: 6
Joined: Fri Jan 10, 2020 9:05 pm

Debugger: how to easily simulate Args line of passed parameters?

Post by Massi » Thu Sep 03, 2020 9:05 am

Dear Support,
I'm debugging a program with different response, depending on passed parameters to the program.
In my application I have a quite complex need to pass parameters to get flexibility.
I'm using the standard /VarName=xxxx passing parameters method.
For sure the included debugger is a key for this and I'm heavily use it.
However I have not found in the debugger a way to simulate the argument line to pass to Macro Scheduler in order to test my appliclation efficiently, unless by defining variables in the code.
I have then to comment them to produce the EXE file.

Do you have any other method/recommendation for this?

Thanks for your feed back
Massimo

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Debugger: how to easily simulate Args line of passed parameters?

Post by JRL » Thu Sep 03, 2020 1:00 pm

Place this at the top of your script and you won't have to worry about remarking. The first line is case sensitive and the second line is the variable assignment for use in the debugger.

Code: Select all

If>PassedParameter={"PassedParameter"}
  Let>PassedParameter=UsefulData
EndIf

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Debugger: how to easily simulate Args line of passed parameters?

Post by Marcus Tettmar » Thu Sep 03, 2020 3:09 pm

You can use Assigned:
https://www.mjtnet.com/manuals/v15/HTML/assigned.html

Code: Select all

Assigned>parm,haveParm
If>haveParm=FALSE
  Let>parm=whatever
Endif
So when run from debug parm and parm is not on the command line it gets set to whatever. Otherwise it's set to whatever was set on the command line.

JRL's method is another way of doing the same thing :-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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