[2] |
|
|||
Returns | <strS> / <err> | |||
charCode | Integer / Float / HexString character code. | |||
CP | Integer CodePage. | |||
Description |
SD Character: Creates a new single byte per digit string object, containing a single character.
The character's value charCode may range from 0-255 for Single Byte per Character CodePages and from 0-65535 for MultiByte CodePages. Note that this command will not return an error if charCode is above 255 for SBC CodePages. In such a case, the resulting string will be containing 2 characters. If no CP is defined, the default CP will be used. If charCode is out of the 0-65535 range, or CP is invalid, an <err> will be returned. |
|||
Examples |
put _sc(65) --for ANSI CodePages, the decimal value 65 maps to the Latin capital letter 'A'
-- A put _sc("41") --"41" is the hexadecimal equivalent of the decimal value '65' -- A put _sc(90) --the resulting string's CP will be the defaultCP. -- Z put _sc(90, 1251) --the resulting string's CP will be 1251 (Cyrillic). -- Z put _sc(33446, 932).pop() --create an strS containing the Hiragana Letter 'E' - え --え --result as seen on Japanese systems -- ‚¦ --result as seen on non Japanese systems The system settings affect the display (Director string) but not the actual strS/D, or any functions performed on it. The Xtra's strings are system independent: put _sc(33446, 932).length --the resulting string will contain 2 digits that map to 1 character -- 1 put _sc(33446, 1252).length --the resulting string will contain 2 digits that map to 2 characters -- 2 Both strings contain the same binary data, but a different CodePage: put _sc(33446, 932).string, _sc(33446, 1252).string -- "‚¦" "‚¦" |
|||
Notes | charCode is a CP independent binary value. It is copied directly to the strS's internal buffer. |
[3] |
|
|||
Returns | <strS> / <err> | |||
charCode | Integer / Float / HexString character code. | |||
CP | Integer CodePage. | |||
Description |
SDS Character Sequence: Creates a new single byte per digit string object, containing one or more characters.
Each character's value may range from 0-255 for Single Byte per Character CodePages and from 0-65535 for MultiByte per Character CodePages. Note that this command will not return an error if charCode is above 255 for SBC CodePages. In such a case, 2 characters will be appended to the string. The default CP will be used as the string's CP. If charCode is out of the 0-65535 range, an <err> will be returned. |
|||
Examples |
put _scs(65) --for ANSI CodePages, the decimal value 65 maps to the Latin capital letter 'A'
-- A put _scs("5A") --"5A" is the hexadecimal equivalent of the decimal value '90' (letter 'Z') -- Z put _scs(65, "5A") -- AZ --the following commands produce the same result put _sc(33446, 932).pop() put _scs(33446).cp(932).pop() put _scs(130, 166).cp(932).pop() |
|||
Notes | charCodes are CP independent binary values. They are written directly to the strS's internal buffer. |