; ReadByte Example
; ----------------

; Save a few bytes so there is something to read
file=WriteFile("demo_bytes.dat")
WriteByte file,65
WriteByte file,100
WriteByte file,255
CloseFile file

; ReadByte reads a single byte and always returns 0 to 255
file=ReadFile("demo_bytes.dat")
a=ReadByte(file)
b=ReadByte(file)
c=ReadByte(file)
CloseFile file

Print "Bytes read from demo_bytes.dat:"
Print "  "+a+"  (the ASCII code for "+Chr$(a)+")"
Print "  "+b
Print "  "+c+"  (the largest value a byte can hold)"

; Clean up the demo file
DeleteFile "demo_bytes.dat"
Print "Deleted demo_bytes.dat"

Print ""
Print "Press any key to close the example"
WaitKey

End
