of_GetIndex


pfcapsrv.pbl   >   pfc_n_cst_lvsrv_datasource   >   of_GetIndex   

Full name pfc_n_cst_lvsrv_datasource.of_GetIndex
Access public
Extend of integer
Return value integer
Prototype public function integer of_GetIndex(n_ds,long)

Name Datatype
No Data

Name Datatype
ll_Cnt long
ll_items long
llvi_Item listviewitem
ls_Key string

public function integer of_GetIndex (n_ds ads_obj, long al_row);//////////////////////////////////////////////////////////////////////////////
//	Public Function:	of_GetIndex
//	Arguments:		ads_obj		The handle to the DataStore (of type n_ds) for the Listview.
//						al_Row		The row in the DataStore that the item points to.
//	Returns:			Integer
//						The Index of the ListView item that points to that row
//						0 if the item was not found
//						-1 if an error occurrs
//	Description:	Return the ListView item index that points to a particular row 
//						in the source DataStore.
//////////////////////////////////////////////////////////////////////////////
//	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_Cnt, ll_items
string			ls_Key
listviewitem	llvi_Item

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

// Check Arguments
if not IsValid(ads_obj) then return -1
if IsNull(al_Row) or (al_row < 1) then return -1

// Get the generated key for the row
ls_key = of_EncodeKey(ads_obj, al_Row)
if ls_key = "!" then return -1

// Find the item
ll_items = ilv_requestor.TotalItems()
for ll_Cnt = 1 to ll_items
	if ilv_requestor.GetItem(ll_Cnt, llvi_Item) = 1 then
		if String(llvi_Item.Data) = ls_Key then return ll_Cnt
	end if
Next

return 0
end function

     
Name Owner
pfc_n_cst_lvsrv_datasource.of_GetIndex pfc_n_cst_lvsrv_datasource

     
Name Owner
listview.getitem listview
listview.totalitems listview
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.string systemfunctions
pfc_n_cst_lvsrv_datasource.of_EncodeKey pfc_n_cst_lvsrv_datasource

     
Full name
No Data

     
Name Scope
No Data