hello guys, please help me if u can
i have a file with 48 bytes ..
I want to read this 48 bytes this way:
TextBox 1 = byte 1 to 12 of 48
TextBox 2 = byte 13 to 24 of 48
TextBox 3 = byte 25 to 48 of 48
Can some1 help me?
Printable View
hello guys, please help me if u can
i have a file with 48 bytes ..
I want to read this 48 bytes this way:
TextBox 1 = byte 1 to 12 of 48
TextBox 2 = byte 13 to 24 of 48
TextBox 3 = byte 25 to 48 of 48
Can some1 help me?
Code:text1.text = left(data,12)
text2.text = mid(data,13,12)
text3.text = right(data,24)
I dont understand .. can you explain ?
If you haven't loaded the data in first then you'd have to do that, but the 3 lines assume you have and it splits the data up...I'll reply in a second with a version that also loads the file in
Bear in mind that this was written on the forum and not in VB...it'll be reformatted a little in VB :-)Code:dim data as string, fre as double
fre=freefile
open "filename" for input as #fre
input #fre, data
close #fre
text1.text = left(data,12)
text2.text = mid(data,13,12)
text3.text = right(data,24)
pay atention please..
my 6 first bytes on file is:
4D 5A 90 00 03 00 = MZ....
When I open the file, i open in BINARY ACCESS, i want to read as HEX the first 6 bytes understand?
Your first post had none of this info, and given the attitude you seem to be giving me for not knowing these facts you hadn't mentioned I will give up trying to help you from now on. Good luck getting help with your problem, I am sure there are umpteen other things you forgot to mention which will make anyone else's suggestions moot.
i am really sorry, i did not know how to explain myself .
Well if your file actually has the Hex code as you described (assuming no spaces between them), the first 6 bytes are really 12 bytes. Each character is one byte. Do you know how to open and read text files? If not, suggest reading this FAQ first.
P.S. Part of the frustration described by smUX can be avoided in the future. Give accurate details of your scenario, including real data and real code, not psuedo data/code.