List2Array - Create an array from the elements in a delimited list |
Top Previous Next |
Syntax
<aList> := List2Array( <cList>, [<cSeparator>], [<lTrimElements>], [<aBrackets>] )
Parameters
<cList>
String containing a list of values.
<cSeparator>
Character to be used as separator when analyzing <cList>. Default is ",".
<lTrimElements>
Flag indicating if the elements should be AllTrimmed before they are put into the return array. If this parameter is .T. and a string containing only blank characters is passed as <cString>, an empty array ( {} ) is returned. If this parameter is .F. and a string containing only blank characters is passed, an array with one element (a string containing these blanks) is returned. The default for <lTrimElements> is .T. .
<aBrackets>
An array containing bracketing information in the form { { <openingBracket>, <closing Bracket> }, ... }. When a separator character is found between a pair of brackets it is not interpreted as a separator. Hence text between a pair of brackets is always kept together. Default is "no brackets".
Return value
An array containing the list elements in the string <cList>.
Description
List2Array analyzes the list <cList> passed to it as a string and returns the singled elements in an Array. The separator between the elements can be specified in <cSeparator>. Optionally every element can be trimmed from leading and trailing spaces. In case the separating character might be used in the elements, bracketing information can be passed. A separator character found between a pair of brackets is not interpreted as a separator.
Classification
Core
Category
Quick Info
Library: cckptcor.lib / cckptcor.dll
See also
Example
|