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


Joined: 06 Dec 2001
Posts: 22

PostPosted: Sat Dec 22, 2001 11:18 am   

#if statements
 
i want a trigger to check to see if 2 flags are set before executing..

currently im stacking the if commands inside each other.....
i.e.
----
#if (@a) (#noop) (#if (@b) (#noop....ect..
-----
is there away to do this ?
---------------
#if (@a),(@b)
--------
so i use 1 #if too check to varables and keep my code simpler or no?
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Sat Dec 22, 2001 12:02 pm   
 
Yes there is a way: just use "AND" or "&"

The format for #IF is: #IF (statement to check) {IfTrue} {IfFalse}

In your case:
#IF (@a AND @b) {commands if both are true} {commands if both are false}

Acaila
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Dec 22, 2001 12:48 pm   
 
Also, the second part of the if statement would be executed if one of them is false, not only when both are false.

Kjata
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