CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

IF Statement

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sjharris



Joined: 11 May 2006
Posts: 78

View user's profile Send private message

IF Statement
PostPosted: Mon May 12, 2008 5:49 am     Reply with quote

Hello all,

This may sound like a stupid question but is there a maximum number of conditions in an IF statement??

My program seems to be doing something odd with 3 conditions in my IF statement:-

i.e.:-

IF( (conditionA==1) && (conditionB==1) && (conditionC==1) )
{
}

I have compiler version:-3.249 and am running a 16F687.

Thanks in advance
Steve
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon May 12, 2008 7:19 am     Reply with quote

I don't know if there is a maximum on the number of conditions in an if-statement, there shouldn't be a limit and it certainly is not limited to three.

v3.249 is known as a stable version so I suspect the problem is somewhere in your program. Can you post a small but complete program demonstrating your problem?
Guest








IF
PostPosted: Mon May 12, 2008 10:16 am     Reply with quote

Hi,

Try this,

IF( conditionA==1 && conditionB==1 && conditionC==1)

Not sure if this is correct, but it works for me.

Regards,
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 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


Powered by phpBB © 2001, 2005 phpBB Group