of_find


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_find   >   of_find   

Full name pfc_n_cst_dwsrv_find.of_find
Access protected
Extend of long
Return value long
Prototype protected function long of_find()

Name Datatype
No Data

Name Datatype
li_rc integer
ll_endrow long
ll_rowfound long
ll_startrow long
ls_coleditstatus string
ls_colname string

protected function long of_find ();//////////////////////////////////////////////////////////////////////////////
//
//	Function: 		of_Find
//
//	Access:  		protected
//
//	Arguments: 		none
//
//	Returns:  		long
//						row number found
//						 0 - not found (end of search)
//
//	Description:  	Searches datawindow using current settings and returns the
//						row number.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
// 5.0.02  Added SelectText() to highlight found value.
// 7.0 	Changed the datatype of li_rowfound to long to provide support 
//			for > 32K rows
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

string	ls_colname
string	ls_coleditstatus
long		ll_startrow, ll_endrow, ll_rowfound
integer	li_rc

//Check required.
If IsNull(idw_requestor) Or Not IsValid(idw_requestor) Then
	Return -1
end If

//Get the current column.
ls_colname = inv_findattrib.is_lookdata[inv_findattrib.ii_lookindex]

//Determine the start and end rows for the find.
li_rc = of_FindStartAndEndRows (ll_startrow, ll_endrow)
If li_rc <= 0 Then
	ib_ongoingfind	= False
	return 0
End If

//Find the row that meets the expression and the Starting and Ending rows.
ll_rowfound = idw_requestor.Find (is_findexpression, ll_startrow, ll_endrow)
If IsNull(ll_rowfound) or ll_rowfound <= 0 Then
	ib_ongoingfind	= False
	return 0
End If

//The find was successful.
ib_ongoingfind = True

//Set focus on the row/column just found.
idw_requestor.ScrollToRow (ll_rowfound)
idw_requestor.SetColumn(ls_colname)
idw_requestor.SetFocus()
If ls_colname = idw_requestor.GetColumnName() Then
	idw_requestor.SelectText (1, 99999)
End If

//Only select the text if the column can receive focus.
ls_coleditstatus = of_GetColumnEditStatus(ls_colname, ll_rowfound)
If ls_coleditstatus = 'editable' or ls_coleditstatus='readonly' Then
	of_SelectText(ls_colname, ll_rowfound, inv_findattrib.ib_matchcase, inv_findattrib.is_find)
End If

//Set last found row and column.
il_lastfindrow = ll_rowfound
is_lastfindcolumn = idw_requestor.GetColumnName()

//Return the found row.
return ll_rowfound

end function

     
Name Owner
pfc_n_cst_dwsrv_find.pfc_findnext pfc_n_cst_dwsrv_find
pfc_n_cst_dwsrv_find.pfc_replace pfc_n_cst_dwsrv_find

     
Name Owner
dragobject.setfocus dragobject
datawindow.find datawindow
datawindow.getcolumnname datawindow
datawindow.scrolltorow datawindow
datawindow.selecttext datawindow
datawindow.setcolumn datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_dwsrv_find.of_selecttext pfc_n_cst_dwsrv_find
pfc_n_cst_dwsrv_find.of_findstartandendrows pfc_n_cst_dwsrv_find
pfc_n_cst_dwsrv_find.of_getcolumneditstatus pfc_n_cst_dwsrv_find

     
Full name
No Data

     
Name Scope
No Data