|
iluminati Newbie
Joined: 05 Apr 2005 Posts: 8
|
Posted: Mon Jul 21, 2008 3:58 am
Zmud to Cmud variable issue |
I used to use the following alias in zmud which does not work in cmud.
#alias {g} {get all %1.corpse}
In zmud if I typed g 5, it would spit out: get all 5.corpse.
In cmud if I type g 5 it spits out: get all
Any ideas?
Thanks. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Mon Jul 21, 2008 4:26 am |
Change it to:
#alias g {get all %{1}.corpse}
and it should work.
Charneus |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jul 21, 2008 5:43 pm |
Charneus is correct.
In CMUD, the syntax a.b is used to fetch the "b" element of the "a" array. So, doing %1.corpse is asking for the "corpse" element of the %1 array (string list or database variable).
The syntax that Charneus gave will work, but the more strict and correct way to do this would be:
#alias {g} {#SEND %concat("get all ",%1,".corpse")}
It's possible that I'll be able to improve this to work better in the future so that CMUD can detect if the %1 is a valid array or not. |
|
|
|
|
|