A1VBCode Forums

How to convert a big value from string to data?


http://www.a1vbcode.com/vbforums/Topic12856.aspx

By Michael_qq - 7/15/2005

Hi, I am trying to convert a big value data (4 bytes unsigned) from a string to a data, and store it in 4 byte in order. e.g.:

            dim s as string

            dim i(3) as byte

            s = "2271560481"      ' is &H87654321

how can I convert it to a data, and store it in i(3), so that:

           i(0) = &H21

           i(1) = &H43

           i(2) = &H65

           i(3) = &H87

Thanks in advance.

 

By Michael_qq - 9/28/2005

Thanks, jviper.

The data is acturally in the range of Unsigned Long, and the data could only be input as string. It seems that no existing function to split the string into 2 long variables.

Perhaps there is no simple way, I have to write a function to process it.