1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 10:30:36 +00:00
QB64-PE/internal/help/_MAPUNICODE_(function).txt
SteveMcNeill 33adc04fc4 Add temp folder to repo. It's necessary as well!
Just more initial setting on... nothing much to see here.
2022-04-28 13:39:56 -04:00

41 lines
1.4 KiB
Plaintext

{{DISPLAYTITLE:_MAPUNICODE (function)}}
The [[_MAPUNICODE]] function returns the [[Unicode]] (UTF-32) code point value of a mapped [[ASCII]] character code.
{{PageSyntax}}
: {{Parameter|utfValue&}} = [[_MAPUNICODE]]({{Parameter|asciiCode%}})
{{PageDescription}}
* UTF-32 values have 4-byte encoding so the return variable should be [[LONG]].
* The {{Parameter|asciiCode%}} can be any [[INTEGER]] value from 0 to 255.
* Returns can be used to verify or catalog the present Unicode mapping.
* The function returns Unicode values for the control characters, CHR$(127) and extended characters without mapping them first.
{{PageExamples}}
''Example:'' Store function return values in an array for ASCII codes 0 to 255 to restore them later.
{{CodeStart}}
{{Cl|DIM}} Unicode&(255)
{{Cl|SCREEN (statement)|SCREEN}} 0
{{Cl|_FONT}} {{Cl|_LOADFONT}}("C:\Windows\Fonts\Cour.ttf", 20, "MONOSPACE") 'select monospace font
{{Cl|FOR...NEXT|FOR}} ascii = 0 {{Cl|TO}} 255
Unicode&(ascii) = {{Cl|_MAPUNICODE (function)|_MAPUNICODE}}(ascii) 'read Unicode values
{{Cl|PRINT}} Unicode&(ascii); 'display values in demo
{{Cl|NEXT}}
'rest of program
{{Cl|END}}
{{CodeEnd}}
{{PageSeeAlso}}
* [[_MAPUNICODE]] {{text|(statement)}}
* [[Unicode]], [[Code Pages]] {{text|(by region)}}
* [[ASCII]], [[CHR$]], [[ASC]]
* [[Text Using Graphics]]
{{PageNavigation}}
<