|
-
May 30th, 2006, 09:48 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Bytes to long integer
Hi, I'd like to get a certain value from an avi video, but I'm not really sure how to do this. Byte 4 - 7 contains the real size of an avi video. These 4 bytes need to be converted to a long integer (I think).
In the example (screenshot):
Byte 4 = EA
Byte 5 = B9
Byte 6 = 8C
Byte 7 = 0E
EA B9 8C 0E = 244103658 bytes (original file size).
Does anybody know how to get Byte 4 - 7 and convert it, so I get the long integer value?
Thanks.
-
May 30th, 2006, 10:07 AM
#2
Re: Bytes to long integer
Since a long integer is 4 bytes, just open the file and get them.
VB Code:
Dim lngFile as Long
Dim lngSize as Long
lngFile = FreeFile
Open FileName For Binary as #lngFile
Get #lngFile, 4, lngSize
Close #lngFile
-
May 30th, 2006, 10:17 AM
#3
Re: Bytes to long integer
VB Code:
Dim s1 As String * 2, s2 As String * 2, s3 As String * 2, s4 As String * 2, s As String, l As Long
s1 = "0E"
s2 = "8C"
s3 = "B9"
s4 = "EA"
s = "&H" & s1 & s2 & s3 & s4
l = s 'l will equal 244103658
I'll leave reading the bytes and stuffing them into the variables to you.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
May 30th, 2006, 10:25 AM
#4
Thread Starter
Frenzied Member
Re: Bytes to long integer
Thanks for the help
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
|