of_DeleteItem


pfcapsrv.pbl   >   pfc_n_cst_lvsrv_datasource   >   of_DeleteItem   

Full name pfc_n_cst_lvsrv_datasource.of_DeleteItem
Access public
Extend of integer
Return value integer
Prototype public function integer of_DeleteItem(integer)

Name Datatype
No Data

Name Datatype
lds_source n_ds
ll_row long
llvi_Item listviewitem

public function integer of_DeleteItem (integer ai_index);//////////////////////////////////////////////////////////////////////////////
//	Public Function:	of_DeleteItem
//	Arguments:		ai_index		The index of the item to be deleted
//	Returns:			Integer
//					 	1	- the item was deleted successfully
//					 	0 - nothing deleted
//						-1	- an error occurred
//	Description:	Delete an item from the listview.  The item's row will be
//						DELETED from its DataStore (the user must call the Update(), however).  
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						6.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_row
listviewitem		llvi_Item
n_ds					lds_source

// check reference variables
if IsNull(ilv_requestor) or not IsValid(ilv_requestor) then return -1
if IsNull(ai_index) or (ai_index < 1) then return -1

if ilv_requestor.GetItem(ai_index, llvi_Item) <> 1 then return -1

if of_GetDataRow(ai_index, lds_source, ll_row) <> 1 then 
	// row is already deleted from datastore
	return -1
end if

// only need to delete the row
lds_Source.DeleteRow(ll_Row)

// Get the parent and previous handle (for undo capability) 
if ib_Undo then
	il_UndoDeleteHandle[1] = ai_index
	ilvi_UndoDeleteItem[1] = llvi_item
	is_UndoType = UNDO_DELETE
end if

return ilv_requestor.DeleteItem(ai_index)
end function

     
Name Owner
pfc_n_cst_lvsrv_datasource.of_DeleteItem pfc_n_cst_lvsrv_datasource
pfc_n_cst_lvsrv_datasource.pfc_undoinsert pfc_n_cst_lvsrv_datasource

     
Name Owner
listview.deleteitem listview
listview.getitem listview
datastore.deleterow datastore
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_lvsrv_datasource.of_GetDataRow pfc_n_cst_lvsrv_datasource

     
Full name
No Data

     
Name Scope
No Data