of_DiscardChildren


pfcmain.pbl   >   pfc_u_tv   >   of_DiscardChildren   

Full name pfc_u_tv.of_DiscardChildren
Access public
Extend of integer
Return value integer
Prototype public function integer of_DiscardChildren(long)

Name Datatype
No Data

Name Datatype
ads_obj n_ds
ll_Child Long
ll_Next Long
ll_Row Long
ltvi_Item TreeViewItem

public function integer of_DiscardChildren (long al_handle);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_DiscardChildren
//
//	Access:  public
//
//	Arguments:
//	al_Handle						The handle of the item for which all child items will
//										be removed.
//
//	Returns:		Integer
//					1	- the children were removed successfully
//					-1	- an error occurred
//
//	Description:	Remove all the items from the TreeView below a specified item.
//						All appropriate rows will be discarded from the DataStores.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1999 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

Long					ll_Child, ll_Next, ll_Row
n_ds			ads_obj
TreeViewItem		ltvi_Item

ll_Child = FindItem(ChildTreeItem!, al_Handle)
Do While ll_Child > 0

	// Recursively remove its child items
	If of_DiscardChildren(ll_Child) = -1 Then Return -1
	
	// Discard its row from the DataStore and the item itself
	If of_GetDataRow(ll_Child, ads_obj, ll_Row) = -1 Then Return -1
	ads_obj.RowsDiscard(ll_Row, ll_Row, Primary!)
	
	ll_Next = FindItem(NextTreeItem!, ll_Child)

	DeleteItem(ll_Child)
	ll_Child = ll_Next
Loop

Return 1

end function

     
Name Owner
pfc_u_tv.of_DiscardChildren pfc_u_tv
pfc_u_tv.of_refreshitem pfc_u_tv
pfc_u_tv.of_deleteitem pfc_u_tv

     
Name Owner
treeview.deleteitem treeview
treeview.finditem treeview
datastore.rowsdiscard datastore
pfc_u_tv.of_DiscardChildren pfc_u_tv
pfc_u_tv.of_getdatarow pfc_u_tv

     
Full name
No Data

     
Name Scope
No Data