FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Website, Reference, Example Bugs
(Moderator: REAS)
   small syntax error in loadBytes()
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: small syntax error in loadBytes()  (Read 360 times)
guillermo

acegas
small syntax error in loadBytes()
« on: Oct 20th, 2003, 5:59am »

The loadBytes() entry under reference has a small typo that creates an error.
the "=" sign in the 7th line (counting blanks) should be "=="
 
correct code:
// open a file and read its binary data  
byte b[] = loadBytes("something.dat");  
 
// print each value, from 0 to 255  
for (int i = 0; i < b.length; i++) {  
  // every tenth number, start a new line  
  if ((i % 10) == 0) {  
    println();  
  }  
 
  // bytes are from -128 to 127, this converts to 0 to 255  
  int a = b[i] & 0xff;  
  print(a + " ");  
}  
// print a blank line at the end  
println();  
 
 
REAS


WWW
Re: small syntax error in loadBytes()
« Reply #1 on: Oct 30th, 2003, 8:41pm »

thanks for the heads up. it's fixed in the master document and should be online soon.
 
+ casey
 
 
Pages: 1 

« Previous topic | Next topic »