We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › readBytesUntil() question
Page Index Toggle Pages: 1
readBytesUntil() question (Read 592 times)
readBytesUntil() question
Jan 3rd, 2010, 12:28pm
 
Hello,

The documentation says:

"Reads from the port into a buffer of bytes up to and including a particular character."

Now I would like to read data until character 126 ("~") is passed but I don't what to include this character into the array.

is there a way to exclude this character from the array?

I thought maybe the shorten() function could be useful:

shorten()

Because of my lack of processing and java/C knowledge I was just curious if there is another solution?

Sorry that I did not include links to the reference, this is because I am still under 5 posts.

Thanks in advance.

Cheers.

Re: readBytesUntil() question
Reply #1 - Jan 3rd, 2010, 2:45pm
 
Huh
Why not simply use readBytes and use a condition to determine when the '~' arrives - then do whatever you need with the array...
Page Index Toggle Pages: 1