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 CCS Technical Support

Is possible to make it in CCS?

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



Joined: 30 Jan 2008
Posts: 197

View user's profile Send private message

Is possible to make it in CCS?
PostPosted: Wed Sep 21, 2011 5:51 pm     Reply with quote

Hello, I want know if is possible to make this conditional:

I have a variable_ X, you need to evaluate if it is within a range of other variables + _


Code:
Variable_Y - 10 <  variable_X < Variable_Y +10



if possible someone could tell me how to implement this?
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Is possible to make it in CCS?
PostPosted: Wed Sep 21, 2011 9:13 pm     Reply with quote

pilar wrote:
Hello, I want know if is possible to make this conditional:

I have a variable_ X, you need to evaluate if it is within a range of other variables + _


Code:
Variable_Y - 10 <  variable_X < Variable_Y +10



if possible someone could tell me how to implement this?


It must be assignment time again..

Code:

if (((y - 10) < x )) && ((x < (y + 10)))
{
   // do something
}

_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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