|
of_buildcolumnnames
|
|
Full name
|
pfc_n_cst_dwsrv_find.of_buildcolumnnames
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_buildcolumnnames(boolean)
|
Name
|
Datatype
|
li_count
|
integer
|
li_i
|
integer
|
li_objects
|
integer
|
ls_editstyle
|
string
|
ls_headernm
|
string
|
ls_obj_column
|
string[]
|
ls_oldfind
|
string
|
ls_oldlookdata
|
string
|
ls_oldreplacewith
|
string
|
protected function integer of_buildcolumnnames (boolean ab_replacelist);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_BuildColumnNames
//
// Access: protected
//
// Arguments:
// ab_replacelist Replace list of column names flag.
//
// Returns: Integer
// Then number of columns
// -1 if an error is encountered.
//
// Description: Populate the array with the column names to use for the
// find or find/replace dialog window. The list is different
// depending if it will be used with the find dialog, or if
// it will be used with the find/replace dialog.
// This will be used with an index that is set
// when the user selects the header label name from the
// dialog window.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.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_objects
integer li_count=0
integer li_i
string ls_headernm
string ls_obj_column[]
string ls_oldlookdata
string ls_oldfind
string ls_oldreplacewith
string ls_editstyle
//Check required.
If IsNull(idw_requestor) Or Not IsValid(idw_requestor) Then
Return -1
end If
//Store the previous current look data (if any)
If inv_findattrib.ii_lookindex > 0 And &
UpperBound(inv_findattrib.is_lookdata) >= inv_findattrib.ii_lookindex Then
ls_oldlookdata = inv_findattrib.is_lookdata[inv_findattrib.ii_lookindex]
ls_oldfind = inv_findattrib.is_find
ls_oldreplacewith = inv_findattrib.is_replacewith
End If
//Reset the current index, find, and replace information.
inv_findattrib.ii_lookindex = 0
inv_findattrib.is_find = ''
inv_findattrib.is_replacewith = ''
inv_findattrib.is_lookdata = ls_obj_column[]
inv_findattrib.is_lookdisplay = ls_obj_column[]
//////////////////////////////////////////////////////////////////////////////
// populate string array for the user to select column from.
//////////////////////////////////////////////////////////////////////////////
//First get the Visible column names to use in search.
li_objects = of_GetObjects ( ls_obj_column, "column", "*", True )
//Get a list of all text objects associated with the column labels
FOR li_i=1 TO li_objects
//Determine if the column is of unwanted type.
ls_editstyle = idw_requestor.Describe(ls_obj_column[li_i]+".Edit.Style")
If ls_editstyle='checkbox' or ls_editstyle='radiobuttons' Then
Continue
End If
//If the list is being costructed for Replace then do not show
//DropDownDataWindow, DropDownListBoxes, Tab=0 Columns, or Display
//only columns. Protected columns will still be
//shown since it could be a row dependendent.
If ab_replacelist Then
If ls_editstyle='dddw' or &
ls_editstyle='ddlb' or &
idw_requestor.Describe(ls_obj_column[li_i]+".TabSequence") = "0" or &
idw_requestor.Describe(ls_obj_column[li_i]+".Edit.DisplayOnly") = "yes" Then
Continue
End If
End If
//Add the column name and column label to the array
li_count ++
ls_headernm= of_GetHeaderName ( ls_obj_column[li_i] )
inv_findattrib.is_lookdata[li_count] = ls_obj_column[li_i]
inv_findattrib.is_lookdisplay[li_count] = ls_headernm
//Reset the Index value (if any)
If ls_oldlookdata = inv_findattrib.is_lookdata[li_count] Then
inv_findattrib.ii_lookindex = li_count
inv_findattrib.is_find = ls_oldfind
inv_findattrib.is_replacewith = ls_oldreplacewith
End If
NEXT
Return li_count
end function