Non expanding vars for mzScript Thread last updated on 2003-07-03 12:42:07

Posted by member 602 on 2003-07-02 14:17:24

First of all sorry if I'm asking something allready asked before, I know everybody says that but I think it has been mentioned before, just can't find it.

I want to do something like this.

*Script exec !VarSet IconFolder $Documents$


...without getting it expanded. I've tried everything I can think of, for example:

%{EVarDollar}documents%{EVarDollar}


where EVarDollar is a "$" or even a ". I've tried putting it all in brackets, single- or double quotes, everything I can think of. I could of course use textedit instead but that feels like overkill for this thing only. Help please...

Posted by member 7 on 2003-07-02 17:07:25 link

mzscript 0.9 beta 12 has an escape code for $.

Posted by member 602 on 2003-07-03 04:25:15 link

I've tried escape codes but it expands it anyway. I could actually get one quote or $ in front of the evar by using the second code above or the escape codes but as soon as I but one in the rear end of it it expands it all. I read the readme and it says that one of the previous versions of mzscript, 0.9 preview, didn't expand vars on !VarSet. I will try that version. Should be an option to save unexpanded vars imo. I'll keep trying.

Posted by member 7223 on 2003-07-03 06:23:53 link

I really can't imagine why you would these vars not getting expanded

Posted by member 7 on 2003-07-03 08:06:32 link

It can't be simply "made an option" because the core does the expansion for you. Otherwise $vars$ wouldn't work the way they do. They aren't meant to be "dynamic" anyway, they're more like $constants$.

Posted by member 99 on 2003-07-03 10:49:07 link

Why do you want this? I don't think it's possible to put an actualy $ in there, the best you can do is probably to use something that will evaluate to $:
!varset p "%"
!varset d "$"
!varset IconFolder "%{p}{d}documents%{p}{d}"
!exec !alert "%{IconFolder}"
!exec !exec !alert "%{IconFolder}"
or use # instead of {d}, but I've got an older version of mzScript loaded.

It might be possible if it expands its own %{vars} but does not call VarExpansion before assigning the value to the variable, but you wouldn't get the $$s back out at the other end, they would expand immediately. (and "not expanding vars" might be %{vars}?)

Posted by member 602 on 2003-07-03 12:42:07 link

Thanx, I'll try all this and see if it works. The reason I wan't it is that if I for example try to set IconFolder to $Ducuments$ I get a path with spaces, and theres no quotes around it. When I later set IconFolder to something else mzscript just replace the first token with space being the delim. But I'll try these things and see if I can get quotes around it some how. Otherwise I'll have to find some other way.