I need to analyse every byte of Integer (4bytes). How can I divide integer into 4 bytes and assign every byte to another variable?
For example, in Visual Basic it is made this way:
Dim Sum As Long
Dim Mark1 As Integer
Dim Mark2 As Integer
Dim Mark3 As Integer
Dim Instring As Variant
If Sum And &H8000& Then
Mark1 = &H8000 Or (Sum And &H7FFF&)
Else
Mark1 = Sum And &HFFFF&
End If
Mark2 = Mark1 And &HFF
Mark3 = (Mark1 And &HFF00&) \ &HFF&
Instring = Chr(Mark2) + Chr(Mark3)
Mark1 = Sum \ &H10000
Mark2 = Mark1 And &HFF
Mark3 = (Mark1 And &HFF00&) \ &HFF&
Instring = Instring + Chr(Mark2) + Chr(Mark3)
So in the result Instring contains 4 bytes of Sum in reverse order. The same result is needed to get in Navision. <img border="0" title="" alt="[Confused]" src="images/smiles/icon_confused.gif" />
Thankyou before <img border="0" title="" alt="[Smile]" src="images/smiles/icon_smile.gif" />
Regards,
Arturs Gedvillo
CTO
0