CharToValue

This function converts a string to Unicode character codes and then stores those values in an integer array.

Function Group Execution Windows Embedded Thin Client
CharToValue String Synchronous Supported Supported Supported

Syntax

CharToValue("tagString","tagArray")
tagString
The name of the string tag, whose value will be converted.
Note: The tag name must be enclosed in quotes, as shown in the syntax diagram, or else the project will try to get the value of the named tag.
tagArray
The name of the integer array that will receive the converted values. If no array index is specfied, then the default is 0.
Note: The tag name must be enclosed in quotes, as shown in the syntax diagram, or else the project will try to get the value of the named tag.

Returned 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]" )