of_reset


pfcmain.pbl   >   pfc_u_calendar   >   of_reset   

Full name pfc_u_calendar.of_reset
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_reset()

Name Datatype
No Data

Name Datatype
ld_FirstDay Date
li_Cell Integer
li_day Integer
li_DaysInMonth Integer
li_FirstDayNum Integer
li_month Integer
li_year Integer
lnv_conv n_cst_conversion
ls_colname string
ls_coltype string
ls_date string
ls_Return String
ls_Year String

protected function integer of_reset ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_Reset
//
//	Access:    Protected
//
//	Arguments:	None.
//
//	Returns:  Integer
//		1 if it succeeds and -1 if an error occurs.
//
//	Description: Resets the calendar visual date according to the requestor date.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.0   Initial version
// 7.0 	On invalid date set the reset date to Null
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_date, ls_colname, ls_coltype
Integer				li_FirstDayNum, li_Cell, li_DaysInMonth
String				ls_Year, ls_Return
Date					ld_FirstDay
Integer 				li_month
Integer 				li_year
Integer 				li_day
n_cst_conversion	lnv_conv

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

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

// Bring focus on the calendar.
SetFocus(this)
SetFocus(dw_cal)

// Validate the date .
// Keep track if the date was valid or not.
if Len(Trim(ls_date)) = 0 or IsNull(ls_date) or (NOT IsDate(ls_date)) then
	SetNull(id_resetdate)
else
	CHOOSE CASE ls_coltype
		CASE 'date'
			id_resetdate = date(ls_date)
		CASE ELSE
//			id_resetdate = lnv_conv.of_date(ls_date)
			id_resetdate = date(ls_date)
	END CHOOSE
end if


If inv_datetime.of_IsValid(id_resetdate) Then
	// Set the new date.  Do not Update the requestor.
	of_SetDate(id_resetdate, False)
Else
	// Set the new date.  The requestor is/is_not updated according to the 
	// attribute.
	of_SetDate(Today(), ib_initialvalue)
End If

Return 1
end function

     
Name Owner
pfc_u_calendar.of_setrequestor pfc_u_calendar
pfc_u_calendar.of_dropdown pfc_u_calendar

     
Name Owner
datawindow.gettext datawindow
systemfunctions.date systemfunctions
systemfunctions.isdate systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.setnull systemfunctions
systemfunctions.today systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.setfocus systemfunctions
pfc_n_cst_datetime.of_isvalid pfc_n_cst_datetime
pfc_u_calendar.of_setdate pfc_u_calendar

     
Full name
pfc_u_calendar

     
Name Scope
No Data