codePointToNum Hex

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

codePointToNum Hex

Post by richmond62 » Mon Jul 13, 2020 12:58 pm

If I do this sort of thing:

Code: Select all

put codePointToNum("ך")
I get 1512, the decimal equivalent of the hexadecimal Unicode number for that character ('resh').

How do I get 0x5E8, the hexadecimal?

Klaus
Posts: 12204
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: codePointToNum Hex

Post by Klaus » Mon Jul 13, 2020 2:06 pm

Hi Richmond,

use the baseconvert() function.

Code: Select all

...
put codePointToNum("ך") into tDecimalNum
put baseconvert(tDecimalNum,10,16) into tHexNum
## -> 5E8
...
Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: codePointToNum Hex

Post by richmond62 » Mon Jul 13, 2020 3:16 pm

Great: Thanks. 8)
-
Screenshot 2020-07-14 at 9.37.43.png
Attachments
16F.livecode.zip
Here's the stack.
(125.52 KiB) Downloaded 35 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: codePointToNum Hex

Post by richmond62 » Wed Jul 15, 2020 2:49 pm

Screenshot 2020-07-15 at 16.47.55.png
-
My friend with 37 fingers was severely disappointed. 8)
Attachments
Base 36.livecode.zip
Here's the stack
(993 Bytes) Downloaded 35 times

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”