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
M0lid3us
Beginner


Joined: 18 Nov 2003
Posts: 19
Location: Italy

PostPosted: Thu Nov 03, 2005 11:28 am   

Another VA question
 
Code:

PATTERN :
=== (*)>[(*)>] si e' connesso.

CODE:
#window {IP} {%time( "hh.nn.ss") : %1 connesso da >[%2>]}
#VA tmp {%replace( %replace( %2, "-", "_"), ".", "_")}
#ADDI @tmp %1
#GAG


I'd like to save all the variables created using @tmp in the "IP_log" class but, if I add the line "#VA @tmp {} _nodef IP_log" every time the trigger fire the @tmp variable became empty

Can anyone help me ??
_________________
Molideus DeepStar

WebMaster - www.clessidra.it - Clessidra Mud
Reply with quote
Tech
GURU


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

PostPosted: Thu Nov 03, 2005 5:01 pm   
 
That's because if you put the variable definition in the trigger, it initializes the variable to be empty every time the trigger fires. Declare the variable outside of the trigger, and you should be fine. See #VARIABLE for more details.
_________________
Asati di tempari!
Reply with quote
M0lid3us
Beginner


Joined: 18 Nov 2003
Posts: 19
Location: Italy

PostPosted: Thu Nov 03, 2005 6:06 pm   
 
The problem is that I don't know the variables name. Is there a command to check if a variable is empty or is already created ??
_________________
Molideus DeepStar

WebMaster - www.clessidra.it - Clessidra Mud
Reply with quote
Pseudo
Wanderer


Joined: 25 Oct 2005
Posts: 99

PostPosted: Thu Nov 03, 2005 6:57 pm   
 
Use #var <name> without specifying what it is equal to. This will tell you if it is undefined or what it is equal to (if it is already created).
Reply with quote
M0lid3us
Beginner


Joined: 18 Nov 2003
Posts: 19
Location: Italy

PostPosted: Thu Nov 03, 2005 11:05 pm   
 
Thanks Pseudo, but if I don't specify the value, i can't set the class
_________________
Molideus DeepStar

WebMaster - www.clessidra.it - Clessidra Mud
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