Hi Harish
The follwoing code may helpful for u.
u can get the length of the following array is 0-5. u can also change it as per ur requirement.
U also can get the value byte by byte using
'bytArray.data(0..55)
Private Const SPMAXQUERYSIZE = 56
Private Type DATAQUERY
Data(SPMAXQUERYSIZE - 1) As Byte
End Type
Private Sub Command1_Click()
'This converts the query string to a query byte array
Dim bytArray As DATAQUERY
'0C65450C
bytArray = StringToDataQuery("0FE2", 4)
End Sub
Private Function StringToDataQuery(QueryStr As String, QueryLength As Integer) As DATAQUERY
Dim ByteIndex As Integer
For ByteIndex = 0 To QueryLength - 1
StringToDataQuery.Data(ByteIndex) = Val("&H" + Mid$(QueryStr, ByteIndex * 2 + 1, 2))
Next ByteIndex
End Function
I hope this logic may useful for u
Regards
Hari K
Enter your message below
Sign in or Join us (it's free).