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
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Thu Dec 21, 2006 12:48 pm   

Absolute paths
 
(Can't seem to find my original post so i'll repost)

Is there a way to reference ABSOLUTE alias and variable paths in cMud?
in zMud you could do stuff like
Code:

#var alluran/data/varname {This is a test}
#alias alluran/aliases/myalias {#say @alluran/data/varname}
alluran/aliases/myalias

And you would see
Quote:

This is a test

displayed on your screen

Is there an equivalent in cMud?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Dec 22, 2006 12:03 am   
 
Yes the same still applies. There is also now the addition of module//whateverPath/name.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Fri Dec 22, 2006 9:49 am   
 
hmm maybe i'm doing something wrong then, i just typed this into cMud (latest)
Code:

#var alluran//portals/data/test moo
#say @alluran//portals/data/test


and then it said
Quote:

//portals/data/test


And i checked, (the alluran package exists, the portals class exists, the data subclass exists) and there is now a variable named alluran//portals/data/test in the default package with the value moo
_________________
The Drake Forestseer
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Fri Dec 22, 2006 9:59 am   
 
Ok, with more testing, #say @Alluran/Portals/Data/Portals works, but #var alluran/portals/data/portals wont reach that variable, not as big a drama i spose, woulda been nice to be able to keep that method for referencing my variables, i never liked putting the class names last
_________________
The Drake Forestseer
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Dec 22, 2006 5:25 pm   
 
Why not try the alternate syntax for setting a variable's value then? //alluran/portals/data/test = moo


Last edited by Larkin on Fri Dec 22, 2006 11:08 pm; edited 1 time in total
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Dec 22, 2006 5:37 pm   
 
Unless this was changed in CMud, #VARIABLE has it's own parameter slot for the class location:

#VARIABLE name {current_value} {default value} "class location"

It wouldn't make much sense to use the package//class/name method, there.
_________________
EDIT: I didn't like my old signature
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Fri Dec 22, 2006 5:58 pm   
 
Except if you dont like including _nodef in all your code because its just asking for typos and errors ;) but thats ok, i'm swapped to this format now. No biggie
_________________
The Drake Forestseer
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Dec 22, 2006 6:42 pm   
 
The syntax is actually this:

//Module/Class/Item

and it works fine for me in variable references (@//somemod/somevar). Haven't used it for anything else, as Matt's described.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Dec 22, 2006 9:53 pm   
 
Yeah, I keep mixing it up. Must have something to do with one of the lanuages I learned sometime. I will get it right eventually.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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