Name
SetListItems -- convert table to optimized list (V9.0)
Synopsis
SetListItems(t, n)
Function
This function can be used to convert an existing table to an optimized list. Optimized lists have the advantage that InsertItem(), RemoveItem(), ListItems() and GetItem() are much faster than when used with normal Hollywood tables.

You have to pass the table to convert in the t argument and the number of list entries in n. Note that the value you pass in n must match the number of list entries currently in the table, i.e. it must match the return value of ListItems().

Note that there are some restrictions when using optimized lists. See CreateList for details.

Inputs
t
table to convert to optimized list
n
number of entries in the list
Example
t = {}
For Local k = 1 To 10000 Do t[k-1] = k
SetListItems(t, 10000)
Print(ListItems(t))
The code above creates a normal Hollywood table, fills it with 10000 items, and then converts it to an optimized list.

Show TOC