Re: [Gambas-user] 16 bit value in hex with MSB and LSB?

2017-05-18 Thread alexchernoff
awesome! Lsl() does not have a definition (F2) in Gambas UI it seems though, at least not 3.9.2. also too bad Gambas UI help does not have a Search function (or does it?) thanks! -- View this message in context: http://gambas.8142.n7.nabble.com/16-bit-value-in-hex-with-MSB-and-LSB-tp59029p5

Re: [Gambas-user] 16 bit value in hex with MSB and LSB?

2017-05-18 Thread ML
Alex, What you're receiving is two characters with ASCII values 3A (":") and 98 (not printable, ASCII code over 7F). In any case, there's no need to convert anything to hex. If bytes come in LSB first, you can use the *Integer@* function along with the *StrPtr* (or similar, don't remember in Gamba

Re: [Gambas-user] 16 bit value in hex with MSB and LSB?

2017-05-18 Thread Tobias Boege
On Thu, 18 May 2017, alexchernoff wrote: > Good day all, > > In a serial string I receive a 16 bit value split into MSB and LSB in hex, > for example 15000 (3A 98) is sent as 2 bytes containing decimal values of > 3A and 98. > > To convert that to decimal, I have to convert each to hex strings,

[Gambas-user] 16 bit value in hex with MSB and LSB?

2017-05-18 Thread alexchernoff
Good day all, In a serial string I receive a 16 bit value split into MSB and LSB in hex, for example 15000 (3A 98) is sent as 2 bytes containing decimal values of 3A and 98. To convert that to decimal, I have to convert each to hex strings, join them, add &H to it and then convert "&H3A98" to de