Hex to Decimal 2s Complement

Mark Wieder ahsoftware at sonic.net
Fri Apr 27 12:29:00 EDT 2018


On 04/27/2018 02:41 AM, Alex Tweedly via use-livecode wrote:
> I should know this - but don't any more :-)
> 
> So there may be a corner case to fix up - but in general, something like
> 
> *put*thetextoffld"F"intotemp*
> put*baseconvert(temp,16,10) intot1*
> if* t1 > 32767*then*
> *put*t1-65536intot1*
> end* *if*
> 
> should do it.

Bingo. Thanks. I was sitting here trying to remember this stuff.
Hermann, of course, would have known this just off the top of his head.

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list