ListCreate |
Top Previous Next |
Prototype
IntHandle:=ListCreate
Description
Creates a new string list
Parameters
None.
Returned value
IntHandle: integer value corresponding to the new list handle.
Notes
None.
Example
//It creates a new list HandleList:=ListCreate;
//It adds element to the list ListAddItem(HandleList,'Element 1'); ListAddItem(HandleList,'Element 2'); ListAddItem(HandleList,'Element 3');
//It counts list element TotalElements:=ListCount(HandleList); ShowMessage('The element counted are: '+IntToStr(TotalElements));
//It finds element Index IndexElements:=ListIndexOfItem(HandleList,'Element 2'); ShowMessage('Element 2 is in position '+IntToStr(IndexElements));
//It deletes an element if (IndexElements>=0) and (IndexElements<TotalElements) then ListDelete(HandleList,IndexElements);
//It destroys the list ListDestroy(HandleList);
|