|
of_getdatarow
|
|
Full name
|
pfc_n_cst_tvsrv_levelsource.of_getdatarow
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_getdatarow(long,ref n_ds,ref long)
|
Name
|
Datatype
|
li_Level
|
Integer
|
ll_Row
|
Long
|
ls_key
|
String
|
ltvi_Item
|
TreeViewItem
|
public function integer of_getdatarow (long al_handle, ref n_ds ads_obj, ref long al_row);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_GetDataRow
//
// Access: public
//
// Arguments:
// al_Handle The handle to the TreeView item for which data is desired.
// ads_obj The handle to the DataStore (of type n_ds) for the item's
// level. Passed by reference.
// al_Row The row in the DataStore that the item points to. Passed by
// reference.
//
// Returns: Integer
// 1 - the item's data was found
// -1 - the item or row was not found
//
// Description: Return the DataStore and row a particular item in the TreeView points
// to. This allows the user to update this row any way they wish.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 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.
//
//////////////////////////////////////////////////////////////////////////////
Integer li_Level
Long ll_Row
String ls_key
TreeViewItem ltvi_Item
// check reference variables
If IsNull(itv_requestor) or Not IsValid(itv_requestor) Then Return -1
If itv_requestor.GetItem(al_Handle, ltvi_Item) = -1 Then Return -1
// determine level
li_level = of_getlevel(al_handle)
If li_level < 1 then Return -1
ads_obj = inv_attrib[li_Level].ids_obj
if IsNull(inv_attrib[li_level].ids_obj) Or not IsValid (inv_attrib[li_level].ids_obj) then
return -1
end if
// find the row
ls_key = of_decodekey( of_getdatastring(al_handle) )
ll_row = ads_obj.GetRowFromRowID( long(ls_key) )
//ll_Row = ads_obj.Find("pfc_tvi_key = '" + String(ltvi_Item.Data) + "'", &
// 1, ads_obj.RowCount())
If ll_Row <= 0 Then
Return -1
Else
al_Row = ll_Row
Return 1
End If
end function