Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

byte by byte from file

Status
Not open for further replies.

KenshinHimura

Programmer
May 8, 2003
91
US
Could someone tell me how I would read a file byte by byte?
The file would be like "wgfggert$%#%23r4s" and I want to read it byte by byte so instead of getting the whole string on each line put into a variable I want each byte of it to be put into different variables.
Like i would read from it the first time and get "w" then read it again and get "g" then "f" etc...

So does ne1 know how? thx :)
 
Hi,

Try this

OPEN "test.txt" FOR BINARY AS #1
FOR x = 1 TO 10
a$ = INPUT$(1, #1) 'first 1 is the number of bytes
PRINT a$
NEXT

Hope this helps.

Pappy
You learn something new everyday.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top