of_reset


pfcmain.pbl   >   pfc_u_calculator   >   of_reset   

Full name pfc_u_calculator.of_reset
Access public
Extend of integer
Return value integer
Prototype public function integer of_reset()

Name Datatype
No Data

Name Datatype
li_rc integer
ls_value string

public function integer of_reset ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_Reset
//
//	Access:    Public
//
//	Arguments:	None.
//
//	Returns:  Integer
//		1 if it succeeds and -1 if an error occurs.
//
//	Description: 
//		Resets the object value to the current value found on the requestor.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_rc
string 	ls_value

// Validate Reference.
If IsValid(idw_requestor) Or IsValid(iem_requestor) Then
	// Good reference.
Else
	Return -1
End If

// Get the current value from the requesting object.
If IsValid(idw_requestor) Then
	ls_value = idw_requestor.GetText()
ElseIf IsValid(iem_requestor) Then
	ls_value = iem_requestor.Text
Else
	Return -1
End If

// Bring focus on the object.
li_rc = SetFocus(this)
li_rc = SetFocus(dw_calculator)

// Validate the value.
// Keep track if the value was valid or not.
ib_validresetvalue = IsNumber(ls_value)
If ib_validresetvalue Then
	// Set the new date.  Do not Update the requestor.
	of_SetValue(Double(ls_value), False)
Else
	// Set the new value.  The requestor is/is_not updated according 
	// to the ib_initialvalue attribute.
	of_SetValue(0, ib_initialvalue)
End If

// Clear the Current value variables.
is_curroperator = EMPTY
is_currvalue = EMPTY

// Clear the Repeat value variables.
is_repeatoperator	= EMPTY
idbl_repeatvalue = 0

Return 1
end function

     
Name Owner
pfc_u_calculator.of_setrequestor pfc_u_calculator
pfc_u_calculator.of_dropdown pfc_u_calculator

     
Name Owner
datawindow.gettext datawindow
systemfunctions.double systemfunctions
systemfunctions.isnumber systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.setfocus systemfunctions
pfc_u_calculator.of_setvalue pfc_u_calculator

     
Full name
pfc_u_calculator

     
Name Scope
No Data