WStringToUCharArray

See Also: Array Functions, Array Variable Assignments, String Functions, Working with Arrays, UCharArrayToWString, UCharArrayToString, StringToUCharArray

Purpose

Copies an entire DataFlex WString to a UChar array with UTF-16 data.

Return Type

UChar[]

Syntax

WStringToUCharArray( {WStringValue} )

Where:

What it Does

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.

Example

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