Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
depan
Newbie


Joined: 04 Jan 2009
Posts: 4

PostPosted: 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 :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
depan
Newbie


Joined: 04 Jan 2009
Posts: 4

PostPosted: Sun Jan 04, 2009 12:34 pm   
 
Thanks, but I thought it isn't the root cause. I want CMUD can execute @goshan directly.
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: 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?
Reply with quote
depan
Newbie


Joined: 04 Jan 2009
Posts: 4

PostPosted: 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.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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'.
Reply with quote
depan
Newbie


Joined: 04 Jan 2009
Posts: 4

PostPosted: 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'
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Jan 06, 2009 8:23 am   
 
Yes.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net