Removes the first element of a list.
List.bdh
ListRemoveFirst( inout theList: list) : boolean;
Parameter | Description |
---|---|
theList | List of number, boolean, float or string, which contains one element less as an out parameter. |
transaction TAListRemoveFirst var lstNumber: list of number init 111, 1, 2, 3, 4, 5; retVal1: boolean; nr: number; begin retVal1 := ListRemoveFirst(lstNumber); if(retVal1 = true) then nr := -1; ListGetFirst(lstNumber, nr); writeln("element at position 1: " + string(nr)); writeln("length of list: " + string(ListGetLength(lstNumber))); else writeln("ListRemoveFirst did not work!"); end; end TAListRemoveFirst;
element at position 1: 1 length of list: 5