Source language: Translate to:

Ifex don't run <> condition

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Ifex don't run <> condition

Postby smartmedia » Wed Aug 18, 2010 9:58 am

Hi..

Can someone confirm or not if the ifex command run correctly when using the <> condition.

I tried to run a code and simply don't run it.

Code: Select all
IfEx "[NumOfDay] <> 6 OR [NumOfDay] <> 7"
SetVar "[Counter]" "[Counter]+1"
endif


NumOfDay variable value is changing from 1 to 8 inside a loop. So normally when rich 6 or 7 will not add to Counter variable 1 more. Instead the Counter variable on the end of loop is 8 and that means that he has count it all...

Did i miss something...???
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby bunker » Wed Aug 18, 2010 10:30 am

I do not know if I understood well, but ...

The OR condition will always be true in your code.

This code will not increase [counter] when [NumOfDay] is 6 or 7.

Code: Select all
IfEx "[NumOfDay] <> 6 AND [NumOfDay] <> 7"
     SetVar "[Counter]" "[Counter]+1"
endif


Greetings
Last edited by bunker on Wed Aug 18, 2010 10:32 am, edited 1 time in total.
User avatar
bunker
 
Posts: 141
Joined: Sat Sep 29, 2007 4:00 pm

Postby Neosoft Support » Wed Aug 18, 2010 10:31 am

I think the problem is with the logic of the IfEx statement. No matter what the value of [NumOFDay] is it will always evaluate as true since [NumOfDay] will always be not 6 OR not 7. (For example 6 isn't 7 and 7 isn't 6.)

If you don't want [Counter] incremented once [NumOfDay] reaches 6, then you should use this code:

Code: Select all
IfEx "[NumOfDay] < 6"
  SetVar "[Counter]" "[Counter]+1"
endif


If you want [Counter] incremented if [NumOfDay] is anything other than 6 or 7 then you should use this code:

Code: Select all
IfEx "[NumOfDay] <> 6 AND [NumOfDay] <> 7"
SetVar "[Counter]" "[Counter]+1"
endif
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Wed Aug 18, 2010 10:44 am

Hi..

I got it.. Thanks...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron