[NTLK] Need NewtonScript help: How to convert an integer value to a hex string

NewtonTalk newtontalk at pda-soft.de
Tue Feb 15 18:21:41 PST 2022


Unfortunately, if there's one thing I am, it's stubborn. I sometimes wish it
wasn't so...

I've been trying to figure this out in vain for the last six hours. I just
gave up.

In NewtonScript I have an integer that is e. g. 255. I want to display it
hexadecimally, i. e. as 0xFF. I can declare this value both ways (local
myVal := 255; or local myVal := 0xFF;), but there seems to be no way to
convert an integer value to a hex string. Except, of course, by coding this
yourself.

I've found the StrHexDump function, but I can't feed it an integer value.
Probably because this function wants a binary object as the first parameter,
which integers aren't in NewtonScript. Or something along these lines, I
can't think straight any longer...

What am I missing? This shouldn't take more than a couple of minutes at
most, not six hours. Grr... 

Thanks

Frank

-- Newton software and hardware at http://www.pda-soft.de





More information about the NewtonTalk mailing list