|
-
Jan 20th, 2010, 04:23 PM
#1
Thread Starter
Member
need help with read bytes
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?
-
Jan 20th, 2010, 04:28 PM
#2
PowerPoster
Re: need help with read bytes
Code:
text1.text = left(data,12)
text2.text = mid(data,13,12)
text3.text = right(data,24)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 20th, 2010, 04:31 PM
#3
Thread Starter
Member
Re: need help with read bytes
I dont understand .. can you explain ?
-
Jan 20th, 2010, 04:33 PM
#4
PowerPoster
Re: need help with read bytes
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
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 20th, 2010, 04:34 PM
#5
PowerPoster
Re: need help with read bytes
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)
Bear in mind that this was written on the forum and not in VB...it'll be reformatted a little in VB :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 20th, 2010, 05:23 PM
#6
Thread Starter
Member
Re: need help with read bytes
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?
-
Jan 20th, 2010, 05:30 PM
#7
PowerPoster
Re: need help with read bytes
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.
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Jan 20th, 2010, 05:31 PM
#8
Thread Starter
Member
Re: need help with read bytes
i am really sorry, i did not know how to explain myself .
-
Jan 20th, 2010, 06:25 PM
#9
Re: need help with read bytes
 Originally Posted by TheMarKs
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?
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|