|
depan Newbie
Joined: 04 Jan 2009 Posts: 4
|
Posted: Sun Jan 04, 2009 6:38 am
A question about "CMUD 2.37 variable store alias command" |
Hi, Folks
I am a newbie for CMUD programme. I desgin a robot, and use a alias to control a series command.
Such as,
"
#case @renwu {goon=goshan} {goon=godugu} {goon=gojin} {goon=gopeng};
@goon
"
I checked the @renwu and @goon value. The renwu is 1 so that goon is "goshan".
goshan is a alias which is "n,n,w,e" (it is a road path).
The CMUD tell me "the command can't be found", because I look at the CMUD terminal
just print "goshan" in screen. Of course "goshan" isn't a defined command in CMUD.
The same view is in debugger tool.
If I printed "goshan" manually in bottom command line I can see the alias was parsed and
show "n,n,w,e" (the road path) directly.
So the question seems to be,
CMUD can't parse (analysis) the alias command in variable.
By the way, even I change the upper command to
"
#case @renwu {goshan} {godugu} {gojin} {gopeng};
"
and don't use variable, the command can't be executed correctly.
I only see print "goshan" and can't be recognized by CMUD.
The alias still can't be parsed.......
Help, help.......... I think it might be a simple question :) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Jan 04, 2009 7:04 am |
#exec @goon
Though if just typing "goshan" on the command line doesn't work, there's some kind of scoping thing going on. |
|
|
|
depan Newbie
Joined: 04 Jan 2009 Posts: 4
|
Posted: Sun Jan 04, 2009 12:34 pm |
Thanks, but I thought it isn't the root cause. I want CMUD can execute @goshan directly.
|
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Sun Jan 04, 2009 3:54 pm |
It sounds like a scope issue to me, are you using multiple packages? Is the goshan alias in a separate package?
|
|
|
|
depan Newbie
Joined: 04 Jan 2009 Posts: 4
|
Posted: Mon Jan 05, 2009 3:16 am |
Not in a separate package. I use this in a *.mud file loaded from Zmud7.21.
By the way, I use CMUD 2.37 evalution version. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Jan 05, 2009 3:47 pm |
If typing 'goshan' on the command line isn't executing the alias, then there is a problem with the alias. However, as Fang said, in your script the line '@goon' should be replaced with '#exec @goon'.
|
|
|
|
depan Newbie
Joined: 04 Jan 2009 Posts: 4
|
Posted: Tue Jan 06, 2009 5:28 am |
As my upper description, if I type 'goshan' on the command line it can be execute directly. So, in CMUD, any variable must be executed by '#exec' ? But in Zmud the variable can be executed without '#exec'
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Jan 06, 2009 8:23 am |
Yes.
|
|
|
|
|
|