|
of_updatechecks
|
|
Full name
|
pfc_w_master.of_updatechecks
|
Access
|
protected
|
Override of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_updatechecks(powerobject[])
|
Name
|
Datatype
|
apo_control
|
powerobject
|
Name
|
Datatype
|
lb_focusonerror
|
Boolean
|
li_pending_rc
|
Integer
|
li_validation_rc
|
Integer
|
lpo_pendingupdates
|
powerobject[]
|
protected function integer of_updatechecks (powerobject apo_control[]);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_UpdateChecks
//
// Access: protected
//
// Arguments:
// apo_control[] The array of object for which the checks need to be
// performed.
//
// Returns: integer
// 1 = updates were found
// 0 = No changes to update were found
// -1 = AcceptText error
// -2 = UpdatesPending error was encountered
// -3 = Validation error was encountered
//
// Description: Perform accepttext, updatestpending and validation on
// the objects.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
Boolean lb_focusonerror
Integer li_pending_rc = 1
Integer li_validation_rc = 1
powerobject lpo_pendingupdates[]
// Determine whether pfc_AcceptText should perform a SetFocus if an
// error is found.
lb_focusonerror = Not ib_closestatus
// Apply the contents of the edit controls to all datawindows
If This.Event pfc_accepttext (apo_control, lb_focusonerror) <0 Then
Return -1
End If
// Determine if any changes are pending.
ipo_pendingupdates = lpo_pendingupdates // *Clear* the instance ipo_pendingupdates
li_pending_rc = This.Event pfc_updatespending(apo_control)
If li_pending_rc < 0 Then
Return -2
End If
// Check for Errors on controls.
If ib_alwaysvalidate Then
li_validation_rc = This.Event pfc_validation(apo_control)
ElseIf li_pending_rc > 0 Then
li_validation_rc = This.Event pfc_validation(ipo_pendingupdates)
End If
If li_validation_rc <0 Then
Return -3
End If
If li_pending_rc = 0 Then
// No changes to update were found.
Return 0
End If
// There are updates pending and no Errors were found.
Return 1
end function