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
cazador
Apprentice


Joined: 08 Dec 2005
Posts: 108

PostPosted: Thu Jan 17, 2008 9:51 pm   

usage of variables in a certain class
 
I want to create a class that has some variables in it. The variables may or may not be replicated in another class. How do I get my triggers, events, etc. To use the variables in that class and not in another class.
I know I can create the variable to the specific class with the command #var variable {} {} class . Is there another way to do this?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Jan 17, 2008 10:04 pm   
 
Firstly use as many local variables in your settings as you can get away with.

Next variable scoping has been largely changed so that if you create variables within a class containing the alias/trigger/macro those variables will probably be checked/changed first.

Another example is to use the class/varname = syntax
This creates the variable in the class that you specified.

Yet another way is to set the class where the variable is to be created like so.

#class name
varname = value
#class 0

There is at least one more method but the one I am thinking of is discouraged so I won't list it here.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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