TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Logical Operators Are Buggy

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
LiquidJin



Joined: 25 Mar 2014
Posts: 2

PostPosted: Mon Apr 07, 2014 11:54 am    Post subject: Logical Operators Are Buggy Reply with quote

I was going crazy with one of my scripts and then I found that the logical or operator does not work correctly in an if statement. Am I doing something wrong?

Code:

#ALIAS testBug
{
   #VARIABLE zero {0};
   #VARIABLE one {one};
   #VARIABLE two {two};
   #VARIABLE three {3};

        #NOP This is a true statement.
   #IF {"$one" != "$two"} {#SHOWME true} {#SHOWME false};

        #NOP This is a false statement.
   #IF {$zero} {#SHOWME true} {#SHOWME false};

        #NOP These should all be true statements.
   #IF {{"$one" != "$two"} || {$zero}} {#SHOWME true} {#SHOWME false};
   #IF {{$zero} || {"$one" != "$two"}} {#SHOWME true} {#SHOWME false};
   #IF {{$zero} || {$three}} {#SHOWME true} {#SHOWME false};
}


Also seeing the same behavior with &&
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3796

PostPosted: Mon Apr 07, 2014 6:31 pm    Post subject: Reply with quote

You have to remove the extra set of braces.

#IF {"$one" != "$two" || $zero} {#SHOWME true} {#SHOWME false};
Back to top
View user's profile Send private message Send e-mail
LiquidJin



Joined: 25 Mar 2014
Posts: 2

PostPosted: Mon Apr 07, 2014 7:41 pm    Post subject: Reply with quote

Scandum wrote:
You have to remove the extra set of braces.

#IF {"$one" != "$two" || $zero} {#SHOWME true} {#SHOWME false};


Doh! Didn't even think to try that. Thanks for responding so quickly.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group