|
Voltz-dk Beginner
Joined: 28 Nov 2007 Posts: 15
|
Posted: Wed Nov 28, 2007 10:44 pm
[2.13] Seems to be a problem with aliases across windows |
It seems that if I use an alias to lighten on the arcane syntax of :win: that parsing doesn't happen properly. (Or at least not as I would expect.)
A short test. 2 windows and a few aliases:
Window T1, alias a (#SAY A) - alias z (:T2:%-1)
Window T2, alias b (#SAY B)
Typing in T1:
:T2:a
:T2:b
z a
z b
I get this in T2:
A
B
a
b
While I would expect:
a
B
a
B
Generally it doesn't seem possible for me to have an alias for :win:, and utilize that to expand an alias in the target window. Am I doing something horribly wrong or is this thing broken?
On a sidenote, the listed example in help doesn't work either: t=T1 - (from T2) @t:hi - this just displayed @t:hi in T2.
I'm using beta 2.13, but that was in hope my issues would have been solved compared to 1.34 :) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Nov 29, 2007 5:10 pm |
OK, now that I see exactly what you are doing I see the problem. Using a variable reference like %-1 doesn't cause it to get executed like it did in zMUD. You need to use the #EXEC command to execute a string as a command. So the correct syntax for your "z" alias would be this:
#alias z {:T2:#EXEC %-1}
That should work the way you need it to.
And yes, using a variable for the window name is not supported in CMUD. I'll try to update the help file when I get a chance. |
|
|
|
Voltz-dk Beginner
Joined: 28 Nov 2007 Posts: 15
|
Posted: Thu Nov 29, 2007 5:43 pm |
Yes, that seems to work exactly as I need it to. Awesome!
I think adding a reference to #EXEC under "Introduction to Multiplaying" might be nice :)
Thanks for clearing things up for me. |
|
|
|
Voltz-dk Beginner
Joined: 28 Nov 2007 Posts: 15
|
Posted: Thu Nov 29, 2007 8:03 pm |
Ok not ENTIRELY what I need :)
While my aliases now work properly I get a parsing error if I try to make a variable.
Given this alias:
Alias: + o1 :G1:#EXEC {%-1}
From a window other than G1
:G1:#EXEC {AutoMira=1200} Works
o1 AutoMira=1200 Parsing Error
Is there some magic trick to this one? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Nov 29, 2007 8:11 pm |
The trouble is that = is a special character in CMUD. You should've encountered this problem using your old aliases, too - CMUD is trying to parse the equals, but isn't sure what it means since it's apparently outside an expression. To use special characters (you'd need to do the same to use, say, {} or () ) you need to put them in quotes "" or escape them with ~. That's always been true.
|
|
|
|
Voltz-dk Beginner
Joined: 28 Nov 2007 Posts: 15
|
Posted: Thu Nov 29, 2007 8:26 pm |
Truth is I initially tried with "o1 #var AutoMira 1200" and got the parsing error - this is how I usually did in ZMud. And then I tried the = syntax to same avail.
But I realize (after reading your post) that "o1 {#var AutoMira 1200}" also works. Wonder if I can get used to either syntax :-\
But thanx for clearing it up. |
|
|
|
|
|