Usage:
OBJECT x = CREATE "dynamic", "list"
If an application wishes to use the Doubly linked list object then it should load it once and keep it loaded. Loading it each time it is used is very inefficient.
The writeToString method as implemented in KCML 6.20 has a memory leak. See the notes on the method on how to avoid it.
For further information see ObjList.htm
List object
With this object you can create a doubly linked list in which list element objects can be ordered. Objects can be added or removed from any position on the list.This collection can be iterated with FOR OBJECT ... NEXT OBJECT
| Method | Returns | Purpose |
|---|---|---|
| Append(OBJECT oElem) | void | Appends an element to the end of a list |
| CreateElement([key$]) | Element | Creates a list element |
| Empty() | void | Destroy all the elements from a list |
| Find(key$) | Element | Returns the list element that exactly matches the key |
| Index(offset) | Element | Returns the list element at the position specified (counted from 1) |
| Prepend(OBJECT oElem) | void | Prepends an element to the start of a list |
| Property | Type | Returns | Purpose |
|---|---|---|---|
| estimate | W | int | Estimated size of list, set before first insert |
| hashsize | RW | int | Size of hash index |
| head | R | Element | Returns the first element in the list |
| length | R | int | Returns the number of elements in the list |
| tail | R | Element | Returns the last element in the list |
List element object
| Method | Returns | Purpose |
|---|---|---|
| GetRecord(BYREF rec$) | void | Retrieve a record from the element |
| LinkAfter(OBJECT oElem) | void | Appends an element after this one |
| LinkBefore(OBJECT oElem) | void | Prepends an element before this one |
| SetRecord(BYREF rec$) | void | Install a record into the element |
| Unlink() | void | Unlink an element from the list |
| Property | Type | Returns | Purpose |
|---|---|---|---|
| key$ | R | string | Get any index key string |
| next | R | Element | Get next element in the list |
| parent | R | List | Gets the list object that contains this element |
| previous | R | Element | Get previous element in the list |
| value$ | RW | string | Get or set the elements value string |