File: binaryfileio.kbs

package info (click to toggle)
basic256 2.0.99.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,888 kB
  • sloc: cpp: 17,185; yacc: 4,025; lex: 1,466; java: 1,091; sh: 39; xml: 33; makefile: 20
file content (37 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# binary file test
# 2012-11-01 j.m.reneau
cls
f$ = "binary.dat"

print "new file"
openb f$
reset
for t = 1 to 20
   n = r()
   print n+" ";
   writebyte n
next t
print
close

print "open and read"
openb f$
while not eof
   print readbyte()+" ";
end while
print

print "position to 10 and read"
seek 10
while not eof
   print readbyte()+" ";
end while
print

close

end

function r()
   r = int(rand*256)
end function