Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Reapy
Newbie


Joined: 04 Oct 2003
Posts: 8

PostPosted: Thu Oct 09, 2003 5:17 pm   

Variable Scope
 
I am quite new to zmud programming, and had a question as to the life span of any user variables that are set. Do all variables retain their value for a particular character all the time? If I say

x = 100

Then close zmud, and open it again and say

#SH x

Would it still be 100? If so, is that true for all variable types?


My other question is unrelated to scope and more to do with organization. This is a very newbie question, and I am sorry if this is touched on in the help files and I missed it. Is there a way to sort out your various triggers and variables for zmud and keep them together. I plan on playing around a lot with it and I don't want the junk I write to be left lingering and cluttering up. So one day I might be trying one thing out, and instead of picking through the trigger and alias lists and deleting (or classing and disabling classes) is there a way for me to write a script, turn it on when playing with it, then disable it for "normal play" so to speak? Or do I simply put them all in a class then turn the class on and off?
Reply with quote
Anabasis
Wanderer


Joined: 26 Jan 2001
Posts: 74

PostPosted: Thu Oct 09, 2003 5:51 pm   
 
With the variables, you have the choice of setting a default value on them, but it's not required.

For your second question, look up Classes.

Ana
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Oct 09, 2003 5:53 pm   
 
Once you save your settings, the variable will exist until it is deleted. If you don't save your settings, it won't.
If it has a default value, it will be reset to the default whenever you connect. If it doesn't, it will retain its last saved value.

Use classes to organize your settings. That's what they're for.
Reply with quote
Reapy
Newbie


Joined: 04 Oct 2003
Posts: 8

PostPosted: Thu Oct 09, 2003 6:31 pm   
 
Ok, I guess as I was typing out the second part classes seemed like the right answer :) Thanks for answering my question about the variable scope.

Reapy
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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