DAY 017: _MAPUNICODE
#6
(11-23-2022, 05:19 AM)SMcNeill Wrote: Smile You have the normal character set that you're used to using and seeing all the time.  _MAPCUNICODE only overwrites the characters that you tell it to -- nothing more.

So, in your case where you mapped the copyright symbol to chr$(0), *ONLY* chr$(0) changed.  All the rest of your ASCII codes are exactly the same as they've always been.  

If you just need a quick "swap out" for a brief moment to display one particular character, let me suggest this style trick:

old_code = _MAPUNICODE(ASCII_position) 'get the unicode value of your old ascii position
_MAPUNICODE new_unicode_value TO ASCII_position  'swap it out with the new unicode value you need

'do stuff with it

_MAPUNICODE(ASCII_position) = old_code 'swap it back to the old value


For example:

old_code = _MAPUNICODE(1) 'store whatever the ASCII character is for that cute little smiley face
_MAPUNICODE 169 TO  1 'your copyright symbol is now chr$(1), and our smiley face is gone...

PRINT CHR$(1) 'print that copyright symbol

_MAPUNICODE old_code TO 1 'map that old code value back, so CHR$(1) is our heroic smiley face once more!

Smilethank you very much for this small but necessary help all of you. Smile 

Gaslouk.
Reply


Messages In This Thread
DAY 017: _MAPUNICODE - by SMcNeill - 11-22-2022, 03:23 PM
RE: DAY 017: _MAPUNICODE - by Pete - 11-22-2022, 05:32 PM
RE: DAY 017: _MAPUNICODE - by PhilOfPerth - 11-23-2022, 04:55 AM
RE: DAY 017: _MAPUNICODE - by PhilOfPerth - 11-23-2022, 05:06 AM
RE: DAY 017: _MAPUNICODE - by SMcNeill - 11-23-2022, 05:19 AM
RE: DAY 017: _MAPUNICODE - by gaslouk - 11-23-2022, 09:58 AM
RE: DAY 017: _MAPUNICODE - by bplus - 11-23-2022, 04:18 PM



Users browsing this thread: 4 Guest(s)