Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Why chr(0) don't work

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
pinkfloyd11

Bascom Member



Joined: 02 Jul 2007
Posts: 247

italy.gif
PostPosted: Tue Nov 06, 2007 5:02 pm    Post subject: Why chr(0) don't work Reply with quote

Dear Friends

This function bufferize the character arrived on serial port.
But when Rx_Char = chr(0) nothing is add to Buffer variable
How I can resolve it?
Thanks


Do
If Ischarwaiting() = 1 Then
Rx_char = Inkey()
Buffer = Buffer + Rx_char
Print Asc(rx_char)
Print Buffer ; " Lung= " ; Len(buffer)
Rx_char = ""
End If
Loop
Back to top
View user's profile
Luciano

Bascom Member



Joined: 29 Nov 2004
Posts: 3149
Location: Italy

blank.gif
PostPosted: Tue Nov 06, 2007 5:53 pm    Post subject: Reply with quote

Hi,

Zero (null) is used for the termination of the strings.
To receive a byte with value 0 you must use a byte array, ISCHARWAITING and INPUTBIN.

Best regards,

Luciano
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
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
You cannot attach files in this forum
You cannot download files in this forum