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
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Sun Oct 04, 2009 3:21 pm   

proper variable usage
 
my variables get created in various places and even when its all ready created it will create an other one and put it somewhere troublesome.

how am i supposed to create and use variables so this doesn't happen?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Oct 04, 2009 4:17 pm   
 
Use the variable command to specify the class name, or alternatively use the path name (//module/class/class/.../varname, or whatever is the correct format)
_________________
EDIT: I didn't like my old signature
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Sun Oct 04, 2009 7:08 pm   
 
i changed all variable usage to explicit.

//ModuleName/ClassName/VariableName=1
@//ModuleName/ClassName/VariableName

More specifically.
//teagan/bot/variables/ipaths=@//teagan/bot/variables/ipaths+1
//teagan/bot/variables/imobs=@//teagan/bot/variables/imobs+1

this seems to have fixed the flaky varible creation issues. i also changed the name of my class variables and counters to just variables in case it was having trouble with the space.

i think this has fixed the issue and from now on i will use all explicit variables.

Thanks Matt
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Oct 04, 2009 7:20 pm   
 
Glad that resolved the issue for you. Remember that when you don't explicitly specify where you want you variables created scoping rules apply so the variable creation will depend on what trigger/alias is executing, the current focus window, the folder structure and what classes are disabled/enabled. When in doubt be specific. Very Happy

Happy Mudding.
_________________
Asati di tempari!
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