Unable to read certain characters (Program Bug and Problems)

by Andrew360 @, Saturday, November 03, 2012, 13:56 (1668 days ago)

Some characters aren't included in Basic's read and readline command. If you add an optional boolean to their code (e.g. read(true)) that specifies if all characters are read, then it would be easier to use binary read. Or, just make a new function like chrread, that would return only one 8-bit character of a file.

This program shows the characters that don't work:

graphvisible 0
outputvisible 1
for i=0 to 255
open "randomfile"
write chr(300)+chr(i)+chr(300)
a$=read+read+read+read
if asc(mid(a$,2,1))=300 then print "Character "+i+" doesn't work for read."
close
kill "randomfile"
next i
print ""
for i=0 to 255
open "randomfile"
write chr(300)+chr(i)+chr(300)
a$=readline+readline+readline+readline
if asc(mid(a$,2,1))=300 then print "Character "+i+" doesn't work for readline."
close
kill "randomfile"
next i


Complete thread:

 RSS Feed of thread

powered by my little forum