B4R Question How to convert 4 bytes into an integer?

Cableguy

Expert
Licensed User
Longtime User
Hi Guys

I am trying to get a byte converted into an integer...

My byte array is formated as follows:

0X71+4 byte binary data+0xff 0xff 0xff

So I need to convert those 4Bytes into an Integer, But HOW?????

(The bytes are in litle endian order)

Please help

[EDIT]

since I cannot delete the post, I leave my working solution here:

Bit.ParseInt(bytec.HexFromBytes(bytec.SubString2(Buffer,9,13)),16)

bytec is a byteconverter object
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
In this case I am receiving this data...
How can I then convert it without wasting memory?
(In this particular case I only need to convert the first byte as my value as a max of int=100)
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Many thanks, will try later
This is for my GUI using a Nextion, what a great display!
 
Upvote 0
Top