CharToValue
- Last UpdatedOct 29, 2026
- 1 minute read
This function converts a string to Unicode character codes and then stores those values in an integer array.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
CharToValue |
String |
Synchronous |
No |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
CharToValue ( " 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, then 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 the number of characters in the string.
Examples
If StrTag = "ABC", then Array[0] = 65, Array[1] = 66, and Array[2] = 67:
CharToValue( "StrTag", "Array" )
If StrTag = "ABC", then Array[10] = 65, Array[11] = 66, and Array[12] = 67:
CharToValue( "StrTag", "Array[10]" )