I have some code which pulls in data from a web server and this is in binary so i need to parse it manually.
So for stage 1 I have made up an array of ints to simulate the data
Dim testCmd = Array As Int ( 0x41, 0x01, 0x00, 0x0a, 0x42, 0x02, 0x22, 0x22, 0x0a )
Here is the walk code
Sub ProcessInputFromServer2( inp() As Int , length As Int) As Int
Dim offset As Int
offset = 0
Do While length > 0
offset = offset + 3 + inp( offset + 1)
length = length - ( 3 + inp( offset + 1) )
Loop
Return 0
End Sub
Now im trying to pass this array of ints to the process routine
ProcessInputFromServer2( testCmd, testCmd.length)
how do i pass the array to the routine?
And the final problem is when I get the real data I get BYTEs, like this
Dim newdata( 2048) As Byte
' Find and walk the binary package returned here
input = HttpUtils.GetInputStream( channelUrl)
length = input.ReadBytes( newdata, 0, input.BytesAvailable)
input.Close
'need newdata as array of ints, ByteConvertor?
'ProcessInputFromServer( newdata, length)
Any expert out there help
joolz
So for stage 1 I have made up an array of ints to simulate the data
Dim testCmd = Array As Int ( 0x41, 0x01, 0x00, 0x0a, 0x42, 0x02, 0x22, 0x22, 0x0a )
Here is the walk code
Sub ProcessInputFromServer2( inp() As Int , length As Int) As Int
Dim offset As Int
offset = 0
Do While length > 0
offset = offset + 3 + inp( offset + 1)
length = length - ( 3 + inp( offset + 1) )
Loop
Return 0
End Sub
Now im trying to pass this array of ints to the process routine
ProcessInputFromServer2( testCmd, testCmd.length)
how do i pass the array to the routine?
And the final problem is when I get the real data I get BYTEs, like this
Dim newdata( 2048) As Byte
' Find and walk the binary package returned here
input = HttpUtils.GetInputStream( channelUrl)
length = input.ReadBytes( newdata, 0, input.BytesAvailable)
input.Close
'need newdata as array of ints, ByteConvertor?
'ProcessInputFromServer( newdata, length)
Any expert out there help
joolz