|
of_register
|
|
Full name
|
pfc_n_cst_dwsrv_dropdownsearch.of_register
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_register(string)
|
Name
|
Datatype
|
ldwc_obj
|
datawindowchild
|
li_count
|
integer
|
li_rc
|
integer
|
ls_displayvaluecoltype
|
string
|
ls_displayvaluecolumn
|
string
|
ls_editstyle
|
string
|
public function integer of_register (string as_column);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Register
//
// Access: public
//
// Arguments:
// as_column Column to register.
//
// Returns: Integer
// 1 if the column was registered.
// 0 if the column was not registered.
// -1 if an error is encountered.
//
// Description:
// Register a dropdowndatawindow or a dropdownlistboxe column to the dropdown
// search services.
//
// *Note: For a dropdowndatawindow column to be added it most have a display
// value type char.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version - Replaces obsoleted function of_AddColumn.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_count, li_rc
string ls_editstyle
string ls_displayvaluecolumn, ls_displayvaluecoltype
datawindowchild ldwc_obj
// Check arguments
If IsNull(as_column) Or Len(Trim(as_column))=0 Or &
IsNull(idw_requestor) Or Not IsValid(idw_requestor) Then Return -1
ls_editstyle = idw_requestor.Describe(as_column+".Edit.Style")
If ls_editstyle = 'dddw' Then
// Get the displayvalue column name.
ls_displayvaluecolumn = idw_requestor.Describe(as_column+".dddw.displaycolumn")
If ls_displayvaluecolumn = '!' Then Return -1
// Get a reference to the DropDownDatawindow.
li_rc = idw_requestor.GetChild(as_column, 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 the new entry.
li_count = upperbound(inv_columns) +1
inv_columns[li_count].s_editstyle = ls_editstyle
inv_columns[li_count].s_columnname = as_column
inv_columns[li_count].dwc_object = ldwc_obj
Return 1
End If
ElseIf ls_editstyle = 'ddlb' Then
// Add DropDownListBox entry into array.
li_count = upperbound(inv_columns) +1
inv_columns[li_count].s_editstyle = ls_editstyle
inv_columns[li_count].s_columnname = as_column
Return 1
End If
// The column was not added.
Return 0
end function
Name
|
Owner
|
datawindow.describe |
datawindow
|
datawindow.getchild |
datawindow
|
datawindowchild.describe |
datawindowchild
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.isvalid |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.pos |
systemfunctions
|
systemfunctions.trim |
systemfunctions
|
systemfunctions.upperbound |
systemfunctions
|