FILEREADBYTE
 
Syntax


FUNCTION FILEREADBYTE( reserved )

Description


FILEREADBYTE is built into version 8.30 and later.

This version returns the next byte in the file, the parameter reserved is not used. The byte value can be 0 to 255, a value of -1 is returned on error.

Example

 i = fileopen("logfile.txt", "r")
 
 j=0
 while(fileeof(0) = 0 )
  j += 1
  i= filereadbyte(0)
  if i<0
   printf("filereadbyte() failed %d", i)
   goto READ_FAILED
  else
   print chr(i);
  endif
 loop
 
READ_FAILED:
 fileclose(0)
 print
 printf("Read %d bytes",j)

   

Differences from other BASICs

See also