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
umdbandit
Wanderer


Joined: 31 Oct 2004
Posts: 94

PostPosted: Wed Apr 04, 2007 4:10 am   

CMUD variable scheme
 
Still getting used to the changes in CMUD variables. I cant really figure out a few things. First off, when I import aliases with assignment statements from zmud, they do not seem to work, and I am not really sure why.


Let me show you another example of something i'm not sure about:



alias 'stat' does the following

$temp2=%params
temp = $temp2
#SHOW Statting
$temp=%query(&short=@temp,Weapons)
#SHOW temp is now $temp
#SHOW temp2 is now $temp2
#SHOW %dbget($temp)


this seems to work fine, and does the query and the dbget


however,

the same alias to do


$temp2=%params
#SHOW Statting
$temp=%query(&short=$temp2,Weapons)
#SHOW temp is now $temp
#SHOW temp2 is now $temp2
#SHOW %dbget($temp)


does not work.

for some reason, the query will not run with a temporary variable



so specifically about the first thing i asked, why does cmud sometimes not want globals to be preceeded by @, and other times it does. This bit of confusion has caused about 95% of my compilation errors, and I am very excited to work it through.
_________________
Rufus- Winner of Stuff
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Apr 04, 2007 5:55 am   
 
I believe your first problem has been answered already recently and I believe it is on the bug list. Should be able to search the forums and verify it.

Quote:
so specifically about the first thing i asked, why does cmud sometimes not want globals to be preceeded by @, and other times it does. This bit of confusion has caused about 95% of my compilation errors, and I am very excited to work it through.


This has also been answered on and off on the forums and in the help files but I will try and sum it up for you.

If I recall correctly with the exception of very few %functions the @ symbol is always required to "retrieve" the value of the @variable

#VAR myvar {my value}
and
myvar="my value"
These examples do not have the @ because we are "assigning" to the variable named myvar. The second example is just a shorthand form of the first.

#VAR myvar {value}
#VAR @myvar {second value}
This would create two variables the first one would be called myvar and the second one would be called the value of @myvar, in this case the variable would be called "value"

If you still don't understand put which examples of using @ and not using it you are getting confused by.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
umdbandit
Wanderer


Joined: 31 Oct 2004
Posts: 94

PostPosted: Wed Apr 04, 2007 5:23 pm   thank you
 
Thanks, I get it now.
_________________
Rufus- Winner of Stuff
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