Assigned command & parameters passed by command line

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Choubi

Assigned command & parameters passed by command line

Post by Choubi » Wed Sep 01, 2004 11:38 am

I am executing a macro and passes some of its parameters by command line.
I was wondering if the command "assigned>" works with those transmitted parameters, because it always returns me false.

Code example:

Command line call : "myMacro.exe /rate=9600"


Then in the macro script:

Message>rate
Assigned>rate,isRateAssigned
Message>isRateAssigned

The first message will show "9600", the seconde "FALSE", whatever I do. but the variable obviously is assigned!!
Can someone help me? I couldn't find any post about it...

Thanks a lot,

greetings from Switzerland

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed Sep 01, 2004 2:34 pm

Hi Choubi,

Rule Number 1 in Macro Scheduler coding is to kill all trailing spaces relentlessly. Are you sure neither Assigned>rate,isRateAssigned nor Message>isRateAssigned contains trailing space(s)?

Happy scripting.

Choubi

Post by Choubi » Thu Sep 02, 2004 6:30 am

Hi armsys,


Have you tried such a code at your place (with a exe file)?
Message>rate
Assigned>rate,isRateAssigned
Message>isRateAssigned
and call : myMacro.exe /rate=9600

I did indeed remove trailing spaces. I checked manually and then used the "edit" "remove trailing space". The problem doesn't come from here. I also tried the %variable% style. I have already done some scripts and read a lot of posts on this forum. Must say thank to you, Bob and the support for the useful information.

I really think I can expect Assigned to return TRUE, or am I expecting too much from Macro Scheduler?

Thanks for the help

Choubi

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Thu Sep 02, 2004 7:28 am

Hi Choubi,

1. I'm terribly sorry for pointing you to a wrong direction.

2. I would like to confirm that all your reported anomalies can be repeated here.

3. Please allow me to offer a work-around solution:
Message>rate
Let>xrate=rate
Assigned>xRate,isRateAssigned
Message>isRateAssigned

I tested the above script fully without any surprise. That's, the script was compiled per your requirement.

4. Please allow me to postulate: Assisgned> can only "see" local variables. The above-mentioned "rate" wasn't created locally; therefore, Assign> deems it "FALSE". What an unfortunate misunderstanding!

Happy scripting. Hope you enjoy using Macro Scheduler.
Last edited by armsys on Thu Sep 02, 2004 7:42 am, edited 1 time in total.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Sep 02, 2004 7:32 am

Hi,

I've looked at this and unfortunately it is in fact the case that Assigned is not checking variables passed as parameters. This is an ommission and will be fixed in the next release.
MJT Net Support
[email protected]

Choubi
Newbie
Posts: 3
Joined: Thu Sep 02, 2004 7:29 am
Contact:

Post by Choubi » Thu Sep 02, 2004 7:49 am

I would be glad to have the next release for free :)

Thanks armsys for the hand, but your code is not still what I want, since it will return true, even if rate is not passed as parameter..

I have tried several around. Nothing worked. Perhaps the key is to do so:

Let>xRate=rate

And then some VB script that checks if xRate is a string (rate not Assigned) or an Integer (rate assigned).

Does someone has a better idea? I am not at ease with VB...

/Choubi
qu'importe le flacon pourvu qu'on ait l'ivresse

Lumumba

Post by Lumumba » Thu Sep 02, 2004 1:14 pm

if xRate is a string (rate not Assigned) or an Integer (rate assigned
I guess MSched lacks similar commands, which in this case are from AutoHotkey.
if var is type
if var is not type

:idea: maybe stupid - a value divided with 1 will/should return "0" if not a number :?: :roll:
Let>Var=ThisIsAText
Let>VarValidateResult=%Var%/1
If>VarValidateResult=0,NotANumber

Choubi
Newbie
Posts: 3
Joined: Thu Sep 02, 2004 7:29 am
Contact:

Post by Choubi » Thu Sep 02, 2004 1:42 pm

Hej Lumumba,

your code unfortunately doesn't make the trick for me.
Let>Var=rate
Let>VarValidateResult=%Var%/1
If>VarValidateResult=0,NotANumber
If I execute it, VarValidateResult is equal to "rate/1" and not to 0 as you say..

That's too bad! Thanks any way

I hope we will soon be able to end this topic, I am still looking for the solution with pure Macro Scheduler syntax, but I think it's not possible.
qu'importe le flacon pourvu qu'on ait l'ivresse

Lumumba

Post by Lumumba » Thu Sep 02, 2004 3:34 pm

Let>Var=12345
Let>VarValidateResult=%Var%/1
If>VarValidateResult%Var%,NotANumber

Label>ANumber
MessageModal>This is a number: %Var%
Goto>Done

Label>NotANumber
MessageModal>This is not a number: %Var%

Label>Done
Tested 8) !

Choubi
Newbie
Posts: 3
Joined: Thu Sep 02, 2004 7:29 am
Contact:

Post by Choubi » Fri Sep 03, 2004 11:20 am

That does the trick :D

Thanks
qu'importe le flacon pourvu qu'on ait l'ivresse

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