MQL4参考 函数转换 StringToShortArray


The function symbol-wise copies a string into a specified place of an array of ushort type. It returns the number of copied elements.

int  StringToShortArray(
   string  text_string,     // source string
   ushort& array[],         // array
   int     start=0,         // starting position in the array
   int     count=-1         // number of symbols



[in]  String to copy


[out]  Array of ushort type (analog of wchar_t type).


[in]  Position, from which copying starts. Default - 0.


[in]  Number of array elements to copy. Defines length of a resulting string. Default value is -1, which means copying up to the array end, or till terminal 0.Terminal 0 will also be copied to the recipient array, in this case the size of a dynamic array can be increased if necessary to the size of the string. If the size of the dynamic array exceeds the length of the string, the size of the array will not be reduced.

Return Value

Number of copied elements.