 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sat Nov 02, 2002 4:11 am
Prevent Variable Creation |
Is there any way to prevent zmud from creating duplicates of variables in different folders?
This is not a bug, let me explain the situation.
I have class X. Defined as set as default while executing.
Within class X, I have 4 variables and some alias.
Situation 1. If a long alias is running from class X, and class X gets turned off from some other means, then any reference to these variables results in the variables being created in the current default class.
Situation 2. Similarly, If a trigger from Class Y is running a long script, and this trigger accesses the variables from class X, and Class X gets disabled during its execution, then the variables get created again in the current class.
This is happening fairly frequently for me, and I keep having to clean up all these extra variables.
Some commands that use the variables within my scripts would be #var,#add,#math often time setting the variable to a value or adding to the variable.
Let me know if anybody has any suggestions on how I can code this to prevent this situation.
Thanks
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.37a
Zmapper Version 1.14 |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Nov 02, 2002 7:31 am |
I can't think of any way to prevent it with your current setup. However, you can eliminate the problem if you remove the "setdef" option and move the variables to the "None" class. It's always active so your variables will never be turned off.
LightBulb
Senior Member |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Nov 02, 2002 8:04 am |
quote:
I can't think of any way to prevent it with your current setup. However, you can eliminate the problem if you remove the "setdef" option and move the variables to the "None" class. It's always active so your variables will never be turned off.
LightBulb
Senior Member
The only thing I can think of that might work (I'll have to check the helpfile to be sure) would be to wrap every variable assignment line in an if statement that checked the %defined() status of each variable. Could probably make a user-defined function out of it so you wouldn't have to have several #IF/%if() statements everywhere...
li'l shmoe of Dragon's Gate MUD |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Nov 02, 2002 6:15 pm |
Ah, I didn't even think of checking settings status. Along the same lines, you could check the class and open it when necessary.
Instead of:
#VAR {var1} {value1}
Use:
#IF (%trigger(classX)) {#VAR {var1} {value1}} {#T+ classX;#VAR {var1} {value1};#T- classX}
I still think it's easier to just move all variables to None or some other class that will always be active.
LightBulb
Senior Member |
|
|
|
 |
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Sun Nov 03, 2002 5:01 am |
perhaps I'll consider moving them to the none class. But this would mean moving about 100 variables.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.37a
Zmapper Version 1.14 |
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Nov 03, 2002 5:53 pm |
Which is just like moving 100 files in your computer. Just select them all, drag and drop.
Kjata |
|
|
|
 |
|
|
|