ListClear Function

Action

Removes all elements of a list.

Include file

List.bdh

Syntax

ListClear(
   inout theList: list) : boolean;
Parameter Description
theList List of number, boolean, float or string, which is empty as an out parameter.

Return value

  • true if successful
  • false otherwise

Example

transaction TAListClear
var
  lstNumber: list of number init 1, 2, 3, 4, 5, 6;
  retVal1: boolean;
begin
  retVal1 := ListClear(lstNumber);
  if(retVal1 = true) then
    writeln("length of list: " + string(ListGetLength(lstNumber)));
  else
    writeln("ListClear did not work!");
  end;
end TAListClear;    

Output

length of list: 0