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
coriandergrass
Beginner


Joined: 07 Oct 2010
Posts: 15

PostPosted: Wed Oct 27, 2010 9:37 am   

why Cmud define a new existing variable ?
 
I have many different variables with different names and put them into different folders, so I can check them easily.

But after a while I noticed that some of those variables (only 1 or 2 of them) are defined again by Cmud. And the one I defined was not used. Why?
Reply with quote
Ithilion
Wanderer


Joined: 02 Sep 2005
Posts: 85

PostPosted: Wed Oct 27, 2010 11:02 am   
 
any duplicate variables? open #class editing? (I do that sometimes) that's all that comes to mind right now
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Oct 27, 2010 12:36 pm   
 
There are numerous possibilities.
1) If any of the classes that a variable resides under is disabled, that variable will be invisible. Setting the variable will create a new one.
2) If a trigger uses the #CLASS command to change the currrent class, setting a variable might create a new one.
3) If there are variables with the same name in different classes, different functions might choose a different variable depending on the scope of that function.
4) If a variable is defined within a window (instead of a module), commands defined in other windows will not see that variable and will create a new variable.
5) If some of your commands run in parallel threads (i.e. you use commands like #WAIT or #THREAD), different threads might try to access the same variable at the same time. This can result in new variables.
6) If you are running a very old version of Cmud, there were some bugs (a long time ago) that resulted in unintended new variables. However, neither versions 2.37 nor any 3.xx version have shown any bugs of this sort.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Oct 27, 2010 8:23 pm   
 
Check the compiled code tab of your setting to see what CMud thinks it should be doing. When it points to the correct variable, you should see a "(class name)" where name is the class that the variable is in. If name is something different, then CMud is stuck (as of the time of compiling) on some other class folder and ALL references to ALL variables (or, at least, more than just this one variable) will point to that class.

This class it's stuck on doesn't necessarily have to be enabled, and the variables this issue creates will always end up in that class (again, regardless of enabled state of the class.)
_________________
EDIT: I didn't like my old signature
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