ListConcat Function

Action

Concatenates two lists into a destination list. All three lists must be of the same type. All elements of the destination list are deleted before the elements of the other lists are copied into it.

Include file

List.bdh

Syntax

ListConcat(
   in firstList: list,
   in secondList: list,
   inout resultList: list) : boolean;
Parameter Description
firstList List of number, boolean, float or string.
secondList List of number, boolean, float or string.
resultList List of number, boolean, float or string, which contains all elements of firstList and secondList as an out parameter.

Return value

  • true if successful
  • false otherwise

Example

transaction TAListConcat
var
  lstFirst: list of number init 1, 2, 3;
  lstSecond: list of number init 4, 5, 6;
  lstResult: list of number init 33, 44, 55;
  retVal1: boolean;
begin
  retVal1 := ListConcat(lstFirst, lstSecond, lstResult);
  if(retVal1 = true) then
    ListPrint(lstResult);
  else
    writeln("ListConcat did not work!");
  end;
end TAListConcat;

Output

element 1: 1
element 2: 2
element 3: 3
element 4: 4
element 5: 5
element 6: 6