INITSTORAGE method (Listbox)
Description
This method is used to pre-allocate a block of memory before items are added to the list. It can help to speed up the initialization of ListBox controls that have a large number of items.
Syntax
nAdded = Exec_Method( CtrlEntID, "INITSTORAGE", nAdded, nBytes )
Parameters
Name | Required | Description |
---|---|---|
nItems | Yes | Specifies the number of items to add |
nBytes | Yes | Specifies the number of bytes (not items) to allocate for strings |
Returns
If the method is successful, the return value is the total number of items for which memory has been pre-allocated, that is, the total number of items added by all successful INITSTORAGE calls.
If the method fails a value of "-1" is returned.
Remarks
N/A
Example
//// Example: Allocate space for 1000 items with 100 bytes of storage each// Call Exec_Method( @Window : ".LST_NAMES", "INITSTORAGE", 1000, 100 )
See Also
LISTBOX LIST property, LISTBOX INSERT method