[EKL Quick Tips] String list concatenation

EKL Knowledgeware 


Very quick tip today : how to concatenate a list of value in a single String. The answer is the method List->Compute() with the "+" argument :

let lst (List)
lst = List ("coucou","hello","servus")

let s (String)
lst.Compute("+","String","x+\";\"+Chr(10)",s)
Notify("",s)

Result will be :

coucou;
hello;
servus;


Note that in the method the x is consider as a "String" as stated in the second argument of the method. Also, you can consider using "Compute" with a list of object (Reference, Instance, Occurrences,...) and code for ex :

list->Compute("+","PLMCoreReference","x->GetAttributeString(\"PLM_ExternalID\");",returnString)

This is usefull to display some information in a Message box or to set multi value in a single Excel cell.