of_register


pfcmain.pbl   >   pfc_u_calendar   >   of_register   

Full name pfc_u_calendar.of_register
Access public
Extend of integer
Return value integer
Prototype public function integer of_register(integer)

Name Datatype
No Data

Name Datatype
li_colcount integer
li_count integer
li_i integer
li_rc integer
ls_colname string
ls_coltype string
ls_editstyle string

public function integer of_register (integer ai_style);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_Register
//
//	Access: 			public
//
//	Arguments:		
//	 ai_style		The style for all the columns.
//
//	Returns: 		integer
//						The number of columns registered.
//						-1 if an error is encountered.
//
//	Description:	
//	Register all the appropriate columns that are holding date fields.
// This version should only be called when "ALL" date columns are desired, 
// otherwise call the version which accepts a column name as an argument.
//	Columns need to be of editstyle 'ddlb', 'edit' or 'editmask'.
//
//		*Note:	For a column to be added it most have a field of type Date.
//		*Note:	Function is only valid when serving a DataWindow control.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_colcount, li_i, li_count, li_rc
string		ls_colname
string		ls_coltype
string		ls_editstyle

// Check the arguments.
If	(ai_style < NONE or ai_style >  DDLB_WITHARROW)  Then
	Return -1
End If

// Check the required reference.
If IsNull(idw_requestor) or Not IsValid(idw_requestor) Then
	Return -1
End If

// Get the number of columns in the datawindow object
li_colcount = integer(idw_requestor.object.datawindow.Column.Count)

// Loop around all columns looking for date columns.
For li_i=1 to li_colcount
	//Get-Validate the name and column type of the column.
	ls_colname = idw_requestor.Describe("#"+string(li_i)+".Name")
	ls_coltype = idw_requestor.Describe("#"+string(li_i)+".ColType")	
	ls_editstyle = idw_requestor.Describe ("#"+string(li_i)+".Edit.Style")
	If ls_coltype = '!' or ls_colname = '!' or ls_editstyle = '!' Then 
		Return -1	
	End If
	
	If ls_editstyle = 'ddlb' or ls_editstyle='edit' or ls_editstyle='editmask' Then
		If of_IsDateType(ls_coltype) Then
			// Add entry into array.
			li_rc = of_Register(ls_colname, ai_style)
		End If
	End If
Next

Return upperbound(is_dwcolumns)
end function

     
Name Owner
pfc_u_calendar.of_register pfc_u_calendar
w_resp_employee.dw_master.constructor dw_master
w_sheet_sales_order.dw_master.constructor dw_master
w_resp_sales_order.dw_master.constructor dw_master
w_resp_salesperson.dw_view.constructor dw_view
w_resp_salesperson.dw_master.constructor dw_master

     
Name Owner
datawindow.describe datawindow
systemfunctions.integer systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.string systemfunctions
systemfunctions.upperbound systemfunctions
pfc_u_calendar.of_isdatetype pfc_u_calendar
pfc_u_calendar.of_register pfc_u_calendar

     
Full name
No Data

     
Name Scope
No Data