of_scrolldetails


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_linkage   >   of_scrolldetails   

Full name pfc_n_cst_dwsrv_linkage.of_scrolldetails
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_scrolldetails(long)

Name Datatype
No Data

Name Datatype
li_i Integer
li_numlinks Integer
ll_row Long
ll_toprow Long
ls_coldata String
ls_expression string
ls_find String
ls_value string

protected function integer of_scrolldetails (long al_row);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_ScrollDetails
//
//	Access:    		protected
//
//	Arguments:
//   al_row:		The current row of the master datawindow
//
//	Returns:   		Integer
// 					1 if it succeeds.
//						0 if there is no data to refresh.
//						-1 if an error occurs.
//
//	Description:  Scrolls detail datawindows based on current row
//					  values in the detail's master.
//
//	   *Note: 	This function is not typically called by the developer.  
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
// 6.0 	Changed to use of_BuildExpression.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_i
Integer	li_numlinks
String	ls_coldata
String	ls_find
Long		ll_row
Long		ll_toprow
string	ls_value
string	ls_expression

// Check for a valid row number.
If IsNull(al_row) or al_row<=0 Then Return -1

// Not a valid operation for a root datawindow. 
If of_IsRoot ( ) Then Return -1

// Loop around all values to create Find expression.
li_numlinks = UpperBound ( inv_linkargs.is_mastercolarg )
For li_i = 1 to li_numlinks
	// Get the current value on the master dw (use the master column).
	ls_value = string( idw_master.inv_Linkage.of_GetItemAny &
			(al_row, inv_linkargs.is_mastercolarg[li_i]))

	// Build the Expresion with the Detail Column.
	ls_expression = of_BuildExpression (0, inv_linkargs.is_detailcolarg[li_i], '=', ls_value)

	// Build the Find statement.
	If IsNull(ls_expression) or Len(Trim(ls_expression))=0 Then Continue
	If ls_find <> "" Then ls_find += ' AND '
	ls_find += ls_expression
Next 

// Find the row in the detail.
ll_row = idw_Requestor.Find (ls_find, 1, idw_Requestor.RowCount())
If ll_row <= 0 Then
	Return 0
End If

// Scroll the detail datawindow.
ll_toprow = Long ( idw_Requestor.Describe ( "DataWindow.FirstRowOnPage" ) )
If ll_toprow <> ll_row Then 
	idw_Requestor.ScrollToRow (ll_row) 
	idw_Requestor.SetRow (ll_row) 
End If 

Return 1
end function

     
Name Owner
pfc_n_cst_dwsrv_linkage.of_retrieve pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv_linkage.of_refresh pfc_n_cst_dwsrv_linkage

     
Name Owner
datawindow.describe datawindow
datawindow.find datawindow
datawindow.rowcount datawindow
datawindow.scrolltorow datawindow
datawindow.setrow datawindow
systemfunctions.isnull systemfunctions
systemfunctions.len systemfunctions
systemfunctions.long systemfunctions
systemfunctions.string systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_dwsrv_linkage.of_isroot pfc_n_cst_dwsrv_linkage
pfc_n_cst_dwsrv.of_GetItemany pfc_n_cst_dwsrv
pfc_n_cst_dwsrv.of_buildexpression pfc_n_cst_dwsrv

     
Full name
No Data

     
Name Scope
No Data