Skip to main content

getNewArrayList

Short summary

A method to generate a new ArrayList.

Return: SingleExecutionResult.SUCCESS: allocation succesful, output arrayList contains new list SingleExecutionResult.ERROR: error during allocation, output arrayList is NULL

Parameters

NameTypeCommentKind
arrayListCNM_CollectionInterfaces.IArrayListthe created array listoutput

Code

Declaration

METHOD getNewArrayList :CNM_ReturnTypes.SingleExecutionResult
VAR_OUTPUT
(* the created array list *)
arrayList :CNM_CollectionInterfaces.IArrayList;
END_VAR
VAR
newList :POINTER TO ArrayList;
END_VAR

Implementation

getNewArrayList := CNM_ReturnTypes.SingleExecutionResult.ERROR;
newList := __NEW(ArrayList);
IF (newList <> 0) THEN
arrayList := newList^;
getNewArrayList := CNM_ReturnTypes.SingleExecutionResult.SUCCESS;
END_IF