|
cazador Apprentice
Joined: 08 Dec 2005 Posts: 108
|
Posted: 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? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
|
|