Making sense out of binary data 
Author Message
 Making sense out of binary data

Appreciate any help.

I have a binay file. I know its structure.  Thus I can read the contents
with the InputB function specifying the number of bytes to read. Once I read
how do I convert it into its corresponding data type item value.

For e.g., if the first 4 bytes is an integer value, once I issue the InputB
function, how can I make sense of the values it returns?



Sun, 10 Aug 2003 04:27:30 GMT  
 Making sense out of binary data
Use copyMem. There are few examples of using copymem in MSDN.

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"
(Destination As Any, Source As Any, ByVal Length As Long)

Dim x as integer
Dim y as integer
Dim buf() as byte 'This is a array which  binary data

CopyMemory x,buf(0),4 'copies the first 4bytes to x
debug.print x
CopyMemory y,buf(4),4 'copies next 4 bytes to y
debug.print y


Quote:
> Appreciate any help.

> I have a binay file. I know its structure.  Thus I can read the contents
> with the InputB function specifying the number of bytes to read. Once I
read
> how do I convert it into its corresponding data type item value.

> For e.g., if the first 4 bytes is an integer value, once I issue the
InputB
> function, how can I make sense of the values it returns?



Sun, 10 Aug 2003 16:59:08 GMT  
 Making sense out of binary data
Isn't Integer a 2-byte-variable ?

Farzad Farahbod schrieb:

Quote:

> Use copyMem. There are few examples of using copymem in MSDN.

> Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"
> (Destination As Any, Source As Any, ByVal Length As Long)

> Dim x as integer
> Dim y as integer
> Dim buf() as byte 'This is a array which  binary data

> CopyMemory x,buf(0),4 'copies the first 4bytes to x
> debug.print x
> CopyMemory y,buf(4),4 'copies next 4 bytes to y
> debug.print y



> > Appreciate any help.

> > I have a binay file. I know its structure.  Thus I can read the contents
> > with the InputB function specifying the number of bytes to read. Once I
> read
> > how do I convert it into its corresponding data type item value.

> > For e.g., if the first 4 bytes is an integer value, once I issue the
> InputB
> > function, how can I make sense of the values it returns?



Thu, 18 Sep 2003 18:25:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VBX makes sense, OCX makes sense - What is OCA?

2. HELP with making binary (crypted) data files

3. making sense of access form design

4. Makes no sense! (I think)

5. Does it makes any sense? (Working with MSComm)

6. Making sense of AVI_COMPRESS_OPTIONS

7. Data-bound Masked Edit makes all data-bound controls not display data

8. Binary Data in SQL 2000/Conver to Bitmap Data For Data Grid View

9. Newbie Binary array question VB6 making brain hurt

10. convert binary data to string data

11. upload both text data and binary data

12. university EMR send outs

 

 
Powered by phpBB® Forum Software