of_getregisterable


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_dropdownsearch   >   of_getregisterable   

Full name pfc_n_cst_dwsrv_dropdownsearch.of_getregisterable
Access public
Extend of integer
Return value integer
Prototype public function integer of_getregisterable(ref string[])

Name Datatype
No Data

Name Datatype
ldwc_obj datawindowchild
li_colcount integer
li_count integer
li_i integer
li_rc integer
ls_allcolumns string[]
ls_colname string
ls_displayvaluecoltype string
ls_displayvaluecolumn string
ls_editstyle string

public function integer of_getregisterable (ref string as_allcolumns[]);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_GetRegisterable
//
//	Access:  		public
//
//	Arguments:
//	as_allcolumns[] By Reference.  All columns belonging to the requestor which
//						could be registered.
//
//	Returns:  		Integer
//	 The column count.
//	-1 if an error is encountered.
//
//	Description:
//	 Determines all columns belonging to the requestor which could be registered.
//
//	 *Note: For a dropdowndatawindow column to be of registering it most have a 
//		display value type char.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1999 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_editstyle, ls_displayvaluecolumn, ls_displayvaluecoltype
string		ls_colname
datawindowchild ldwc_obj
string		ls_allcolumns[]

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

// Loop around all columns looking for dddw or ddlb columns.
For li_i=1 to li_colcount
	//Get-Validate the name and edit style of the column.
	ls_editstyle = idw_requestor.Describe("#"+string(li_i)+".Edit.Style")
	ls_colname = idw_requestor.Describe("#"+string(li_i)+".Name")
	If ls_colname = '!' or ls_editstyle = '!' Then Return -1	

	If ls_editstyle = 'dddw' Then
		// Get the displayvalue column name.
		ls_displayvaluecolumn = idw_requestor.Describe(ls_colname+".dddw.displaycolumn")
		If ls_displayvaluecolumn = '!' Then Return -1

		// Get a reference to the DropDownDatawindow.
		li_rc = idw_requestor.GetChild(ls_colname, ldwc_obj)
		If li_rc<>1 Then Return -1
		
		// If displayvalue column is not of type "Char," skip it.	
		ls_displayvaluecoltype = ldwc_obj.Describe(ls_displayvaluecolumn+".coltype")
		If pos(ls_displayvaluecoltype, "char") >= 1 Then
			// Add entry into array.
			li_count = upperbound(ls_allcolumns)+1
			ls_allcolumns[li_count] = ls_colname
		End If
	ElseIf ls_editstyle = 'ddlb' Then
		// Add entry into array.
		li_count = upperbound(ls_allcolumns)+1
		ls_allcolumns[li_count] = ls_colname		
	End If
Next

as_allcolumns = ls_allcolumns
Return UpperBound(as_allcolumns)

end function

     
Name Owner
pfc_u_tabpg_dwproperty_srvdropdownsearch.pfc_propertypopulate pfc_u_tabpg_dwproperty_srvdropdownsearch

     
Name Owner
datawindow.describe datawindow
datawindow.getchild datawindow
datawindowchild.describe datawindowchild
systemfunctions.integer systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.string systemfunctions
systemfunctions.upperbound systemfunctions

     
Full name
No Data

     
Name Scope
No Data