|
umdbandit Wanderer
Joined: 31 Oct 2004 Posts: 94
|
Posted: 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 |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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. |
|
|
|
umdbandit Wanderer
Joined: 31 Oct 2004 Posts: 94
|
Posted: Wed Apr 04, 2007 5:23 pm thank you |
Thanks, I get it now.
|
|
_________________ Rufus- Winner of Stuff |
|
|
|
|
|