(Available in 00 TS Tools(Base) - TS_Tools_PointerSafe)
Purpose
Add a new item
Syntax
lAdded:=oPointerSafe:ItemAdd( pItem[ , LOGIC ] )
Arguments
pAddItem
PTR, Pointer to the data-item to add.
lAutoSize
[LOGIC], If TRUE the the size of the data-store will be re-sized, by adding space for 10 data-items, when needed.
Description
Add a new item, This method is provided for the application programmer and is used to add data-items to the data-store. The data-item is added to the end of the data-store and the number of data-items is incremented.
Returns
lAdded = LOGIC
Example
METHOD UsingThePointerSafe( ) CLASS MyObject
LOCAL oPointerSafe AS TS_PointerSafe
LOCAL pItem AS PTR
oPointerSafe:=TS_PointerSafe{ SELF, 10, _SIZEOF( _WinGUID ) }
oPointerSafe:ItemAdd( TS_GUID_IDispatch( ) )
oPointerSafe:ItemAdd( TS_GUID_IUnknown( ) )
oPointerSafe:ItemAdd( TS_GUID_ITypeInfo( ) )
IF oPointerSafe:ItemLocate( TS_GUID_ITypeInfo( ) )
oPointerSafe:ItemDel( oPointerSafe:ItemIndex )
END
IF !oPointerSafe:ItemLocate( TS_GUID_ITypeInfo( ) )
oPointerSafe:ItemAdd( oPointerSafe:ItemIndex )
END
oPointerSafe:ItemFirst( )
WHILE pItem<>NULL_PTR
IF pItem<>NULL_PTR
SELF