Cascaded expansions in mzScript Thread last updated on 2004-05-01 04:14:47

Posted by member 602 on 2004-04-30 05:23:17

First of all, sorry if this has already been asked. I made a quick scan but it's hard to tell with the search function out of order.

My problem is this. I'm trying to make a script where the user can add a new shortcut (or remove one) using Maduins Button. The script sets all the variables using an integer as index for the buttons, kind of like this:

...
*Script exec !VarAdd ButtonCount 1
*script exec !VarSet Button%{ButtonCount}Width 40
...

This way the will be no limit as to how many buttons that can be added. Now after all the variables have been set, I'm using textedit to save them to a special button file. Like this:

*Script exec !TextAppend "$ButtonFile$" "*Button
Button%{ButtonCount}"
*Script exec !TextAppend "$ButtonFile$"
"Button%{ButtonCount}Width %{Button%{ButtonCount}Width}"

Now the first line gets saved right, but the second looks like this:

Button1Width Width}

Seems mzScript doesn't know in which order to expand the variables. So if anybody has any idea how to fix this in some way, please let me know. Thanx in advance.

Posted by member 37809 on 2004-04-30 13:33:36 link

Posted by member 602 on 2004-05-01 04:14:47 link

Thanks a lot.