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
Virus
Wanderer


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Tue Jul 23, 2002 1:36 pm   

#if this AND this are the same then...
 
I need to know how to do that. Basically I am using code like
#IF (me=%lower(me)) {#SH Good}
but I also need it to check to see if 7<9. So in other words needs to be
#IF (me=%lower(me) AND 7<9) {#SH good}
Right now no matter what I do, as long as the first statement passes the test it works, ad das not good for me. Pls help?

Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
Humpton
Apprentice


Joined: 10 Oct 2000
Posts: 158
Location: Chicago, IL

PostPosted: Tue Jul 23, 2002 2:17 pm   
 
I use nested #IFs.

First I assume me is a variable, so it should be @me. I'm also assuming the check for 7<9 is a dummy thing to force it to work.

#IF (@me=%lower(@me) {

#ECHO We passed the first test.
#IF (7<9) {
#ECHO Ok, we passed the second test, too.
} {
#ECHO Ok, we failed the second test.
} {
#ECHO We failed the first test, so never checked the next test
}


Make sense?

Stay JOLLY!
H

___
Humpton lives like he types.... fast, and full of mistakes!

Core 2651: For those who prefer the future to the past.
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Tue Jul 23, 2002 3:07 pm   
 
I was unable to reproduce your problem. Could you provide the exact script in question please.

Troubadour
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Jul 23, 2002 5:41 pm   
 
Never trust what you believe to be the order of operation in any language on logic tests. In every language I work with I follow that rule and take the time to put the paranthesis.

#IF (("me"=%lower("me"))&(7<9)) {#SH good}

Also it is well worth it to take the time to put the quotes around all string references, except @Variable.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 23, 2002 6:23 pm   
 
me = %lower(me) This is TRUE
7 < 9 This is also TRUE
If you want to get a FALSE condition you should use a statement that isn't TRUE.

LightBulb
Senior Member
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