Array2List - Create a string containing all elements of an array

Top  Previous  Next

Syntax

<cString> := Array2List( <aData>,[<cSeparator>],[<lTrim>] )

Parameters

<aData>

 

Data array containing character values to be converted to a list.

 

<cSeparator>

 

Separator to be used to separate the elements of <aData> in the resulting list. Default is "," (comma).

 

<lTrim>

 

Flag if the elements in <aData> are to be AllTrimmed before being put in the list. Default is .F.

Return value

A string containing a string containing a list of the values passed in <aData>. The elements are separated by <cSeparator>.

Description

Array2List creates a character string from an array of strings using passed formatting information. The separator between the elements can be chosen and each element can be trimmed before being put in the list.

Classification

Core

Category

Array and string utility

Quick Info

Library: cckptcor.lib / cckptcor.dll

Example

 

#INCLUDE "CockpitCoreLibs.ch"

 

FUNCTION Main

 

* This will output the string "Good.morning.dear.worries"

? Array2List({"  Good  ","  morning  ","  dear  ","  worries  "},".",.T.)

 

RETURN NIL