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

CCS FAQ #25 has a syntax error

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



Joined: 12 May 2004
Posts: 54
Location: edinburgh, Scotland

View user's profile Send private message

CCS FAQ #25 has a syntax error
PostPosted: Wed May 26, 2004 1:57 pm     Reply with quote

I wanted to write a funciton that waited for a character over the RS232 link, but I spotted the answer here.

I copied + pasted the code into my program and tried compiling, but it kept telling me that kbhit is an "Undefined identifier".

I checked the paper manual and compared it to the online version:

Manual
Code:
while(!kbhit()&&(++timeout<50000))      // 1/2 second


Online version
Code:
while(!kbhit&&(++timeout<50000)) // 1/2 second



The vital difference is that the online version is missing (), meaning kbhit is not recognised as a funciton by the complier.

CCS people, could we please get it sorted?
ckielstra



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

View user's profile Send private message

PostPosted: Wed May 26, 2004 3:14 pm     Reply with quote

Please report this kind of bugs also to CCS directly. This forum is mainly for users of CCS so reporting bugs here can be useful to other users, but CCS employees are not likely to see it.
Guest








PostPosted: Thu May 27, 2004 1:23 am     Reply with quote

Quote:
(from CCS C Compiler Help)

KBHIT()

Syntax:
value = kbhit()

Requires
#use rs232


Did u #use rs232?
JBM



Joined: 12 May 2004
Posts: 54
Location: edinburgh, Scotland

View user's profile Send private message

Re: guest
PostPosted: Thu May 27, 2004 5:10 am     Reply with quote

Yes I did #use RS232.

If I hadn't, when the kbhit() function apperas a few lines later the compiler would have given me an error saying that the funciton kbhit() had not been defined.

The proof of the pudding is in the eating, and by adding the () to the line I quoted in my first post made everthing work fine.
Guest








PostPosted: Thu May 27, 2004 5:41 am     Reply with quote

I like your pudding Laughing
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

PostPosted: Thu May 27, 2004 8:04 am     Reply with quote

Fixed
Guest








PostPosted: Thu May 27, 2004 8:10 am     Reply with quote

Darren, are you from CCS?

Surprised
page 109 is OK
page 222 is not
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

PostPosted: Thu May 27, 2004 12:17 pm     Reply with quote

Yes I am, but I have no control over the manual if that's what you're asking.
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