See Also: Array Functions, Array Variable Assignments, String Functions, Working with Arrays, UCharArrayToWString, UCharArrayToString, StringToUCharArray
Copies an entire DataFlex WString to a UChar array with UTF-16 data.
UChar[]
WStringToUCharArray( {WStringValue} )
Where:
{WStringValue} is the DataFlex WString to convert.
WStringToUCharArray copies an entire DataFlex WString to a UChar array with UTF-16 data.
Note that a UTF-16 string in a UChar array uses 2 or 4 array items per character. When passing a regular String into the function, it will be converted into a WString and the UChar array will still contain UTF-16 data. Use StringToUCharArray to create arrays with single byte strings.
This sample copies the DataFlex string sValue to the UChar array uaMyString.
Procedure Test
UChar[] uaMyString
WString wsValue
Move "This is a test" to wsValue
Move (WStringToUCharArray(wsValue)) to uaMyString
End_Procedure