Multiple parameters

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
ShakaZ

Multiple parameters

Post by ShakaZ » Mon Feb 07, 2005 4:46 pm

Hello all,

quite new to scripting... as a matter of fact i just started today ;-) & stumbled on the MacroScheduler. After some trial i had a macro to draw a fractal with 1 parameter set.
Next step was creating a litle box to have easier interaction. This works OK
But when i try to use multiple parameters the problems appear...

Basically what i try to do is have 3 textboxes (start, end & step values) & for each value in that range the fractal macro must be called. Later i also want to do this for multiple parameters...

Here are some critical parts of the script i'm trying to fix:

Edit=RangeSt,15,22,230,t0
Memo=RangEnd,15,60,230,20,t1
Memo=Step,15,95,230,20,dt
Button=Go!!!,15,190,100,20,3
Button=Out ==>>,125,190,100,20,2
EndDialog>MyDialog

Label>MainLoop
Show>MyDialog,result
If>result=2,End
If>result=3,PrepareParam
Goto>MainLoop

SRT>PrepareParam
Let>Param=MyDialog.RangeSt
ChaoScope
Let>Step=MyDialog.Step
Let>Fin=MyDialog.RangEnd-Step
While ParamPrepareParam

SRT> ............ END>ChaoScope

Label>End


Thanks to those who are still here ... for the questions :

* It seems both buttons are disabled right from the start after i added the 2 supplementary textboxes (Memo type as suggested in the manual...). I tried to use 4 & 5 instead of 2 & 3 but that didn't help.

* The PrepareParam function should set the Param & calls the ChaoScope macro (don't know if i'm allowed a While-Do & if so what the exact syntax is)

* How can i call Param from within the ChaoScope routine, Param, PrepareParam.Param or something else?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Feb 07, 2005 5:13 pm

Looks like this:
ChaoScope

Should be:
Gosub>ChaoScope

If not, then I do not understand what "ChaoScope" might be.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Guest

Post by Guest » Mon Feb 07, 2005 6:54 pm

I tried it, unfortunately it's of no help ...

ChaoScope is a macro that already works when there's only 1 parameter. That parameter comes directly from the input dialog box through MyDialog.RangeSt

But with more text boxes even the 1st call to ChaoScope doesn't pass.
As both buttons are ineffective it seems the problem comes from the way the other boxes are defined

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Feb 07, 2005 8:53 pm

ChaoScope is a macro that already works
To call macros you need the macro command, with the full path and filename and extension. And the variables must already exist in the macro being calles. Call the macro something like this, using the real variable names:

Macro>Drive:\Path\macroname.scp /variable1=%RangeSt% /variable2=%RangeEnd%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by armsys » Tue Feb 08, 2005 6:54 am

Hi Bob,

With all due respect, the full path of the macro isn't always required as long as it's located in the current %CWD%, another undocumented feature of Macro Scheduler. CWD may be changed manually (in the script) or accidentally. Hope it helps.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Feb 08, 2005 3:50 pm

A lot of my work has macros in different folders across a network. And I have just developed some work habits with forgotten reasoning. By always including the path, then I don't have to worry about the working directory.

Just checked to see what created this method for me ...... from Help on MACRO:
It is also advisable to specify the full path should the path change during the execution of the calling macro.
That is probably what created my syntax habit....... So including the path will not cause a problem, but excluding it may cause a problem under some conditions. So, I include it at all times.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by support » Tue Feb 08, 2005 3:57 pm

If you know your macros are always going to be in the same directory then you can also do this:

Macro>%SCRIPT_DIR%\macroname.scp

This would make sense for distributed macros where they are installed into the same folder, but you don't know prior to installation what folder that might be.
MJT Net Support
[email protected]

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

Post by armsys » Wed Feb 09, 2005 12:15 am

Hi Support,

Happy Chinese New Year!

Thank you for clearing up the clouds. Then, with respect to the macro path(s), I would be delighted to learn about the differences between:
SCRIPT_DIR
SCRIPT_FILE
CDW

SCRIPT_FILE appears to be a catalog of all scripts (macros).

BTW, is it legal to modify these system variables programmatically? Say, Let>SCRIPT_DIR=Z:\CyberCitizen

ShakaZ

Post by ShakaZ » Wed Feb 09, 2005 12:57 am

SRT> ............ END>ChaoScope

As you can see in my first post the ChaoScope macro is part of the file. It's a recording i have done and which should be called in a loop. So i have no path to enter... :cry:

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Feb 09, 2005 2:00 am

It looks like I made some bad assumptions.

There is no legal syntax in Macro Scheduler for
ChaoScope

or

SRT> ............ END>ChaoScope
I thought you were using them as shorthand for another macro named ChaoScope.

For us to help you it would be best if you provide all actual code as you are using it.

If "SRT> ............ END>ChaoScope" is real, then it is incorrect.

If "ChaoScope" is real, it also is incorrect . Perhaps you should be using GoSub>ChaoScope ?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by support » Wed Feb 09, 2005 8:07 am

armsys wrote:Hi Support,

Happy Chinese New Year!

Thank you for clearing up the clouds. Then, with respect to the macro path(s), I would be delighted to learn about the differences between:
SCRIPT_DIR
SCRIPT_FILE
CDW

SCRIPT_FILE appears to be a catalog of all scripts (macros).

BTW, is it legal to modify these system variables programmatically? Say, Let>SCRIPT_DIR=Z:\CyberCitizen
Again, I draw your attention to the help file. In Command Reference -> Using Variables -> System Variables you will find an explanation of the above variables.

Yes, you can modify these variables if you so wish.
MJT Net Support
[email protected]

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

Post by support » Wed Feb 09, 2005 8:12 am

ShakaZ,

Possibly you intend something like this. I'm not sure if this is quite what you want but it is correct syntax. As Bob says, feel free to submit your full script and/or your actual requirements. But the following should at least explain what the syntax should look like:


SRT>PrepareParam
Let>Param=MyDialog.RangeSt
GoSub>ChaoScope
Let>Step=MyDialog.Step
Let>Fin=MyDialog.RangEnd-Step
Repeat>Param
Let>Param=Param+Step
GoSub>ChaoScope
Until>Param,End
END>PrepareParam
MJT Net Support
[email protected]

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