CharToValueW
- Last UpdatedOct 29, 2026
- 1 minute read
This function converts a string to Unicode character codes, combines each two codes into a double-byte word, and then stores those values in an integer array.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
CharToValueW |
String |
Synchronous |
No |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
CharToValueW ( " tagString " , " tagArray " )
tagString
The name of the string tag, whose value will be converted.
Note: If this parameter is enclosed in quotes, the string literal will be used. Otherwise, the value of the tag/expression will be used.
tagArray
The name of the integer array that will receive the converted values. If no array index is specified, the default is 0.
Note: If this parameter is enclosed in quotes, the string literal will be used. Otherwise, the value of the tag/expression will be used.
Return value
Returns the number of array elements used, which should be equal to half the number of characters in the string.
Notes
Because of how each two character codes are combined into single value, this function only supports Unicode character codes 0 through 255. For character codes greater than 255, or when double-byte words are not needed, use the CharToValue function.
Examples
If StrTag = "Studio", then Array[0] = 29779 ("St"), Array[1] = 25717 ("ud"), and Array[2] = 28521 ("io"):
CharToValue( "StrTag", "Array" )
If StrTag = "Studio", then Array[10] = 29779 ("St"), Array[11] = 25717 ("ud"), and Array[12] = 28521 ("io"):
CharToValue( "StrTag", "Array[10]" )