of_setquerycols


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_querymode   >   of_setquerycols   

Full name pfc_n_cst_dwsrv_querymode.of_setquerycols
Access public
Extend of integer
Return value integer
Prototype public function integer of_setquerycols(string[])

Name Datatype
No Data

Name Datatype
li_i integer
li_j integer
li_maxcols integer
li_maxset integer
li_rc integer
ls_collist string[]

public function integer of_setquerycols (string as_querycolumns[]);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_SetQueryCols
//
//	Access:  public
//
//	Arguments:
//   as_querycolumns[]  column names that allow data to be entered in querymode
//
//	Returns:  integer
//	 1 = success
//	-1 = error
//
//	Description:
//	To identify the columns that can have query criteria entered
//	when the datawindow is in QueryMode
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
// 6.0	Store the QueryColumns in instance variable.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_maxcols
integer	li_i
integer	li_j
integer	li_maxset
integer	li_rc
string		ls_collist[]

// Check the datawindow reference
if IsNull(idw_requestor) Or not IsValid (idw_requestor) then
	return -1
end if

// Get the upperbound value
li_maxcols = UpperBound (inv_querymodeinfo) 

// li_maxcols will be 0 if no columns have previously been set
if li_maxcols = 0 then
	
	// Initialize the attribute class with information of all the columns.
	// Store the original protect attribute, and initially set column
	// as not being a queryable column.
	li_rc = of_GetObjects (ls_collist, "column", "*", true) 
	li_maxcols = UpperBound (ls_collist)

	if li_maxcols = 0 then return -1

	for li_i = 1 to li_maxcols
		inv_querymodeinfo[li_i].s_col = ls_collist[li_i]
		inv_querymodeinfo[li_i].b_state = false
		inv_querymodeinfo[li_i].s_protect = idw_requestor.Describe (ls_collist[li_i] + ".protect")
	next

else

	// Reset the queryable columns flag
	for li_i = 1 to li_maxcols
		inv_querymodeinfo[li_i].b_state = false
	next

end if
	
// Find the columns being set and tag it as queryable based on passed argument.
li_maxset = UpperBound (as_querycolumns)
for li_i = 1 to li_maxset
	for li_j = 1 to li_maxcols
		if Lower (inv_querymodeinfo[li_j].s_col) = Lower (as_querycolumns[li_i]) then
			inv_querymodeinfo[li_j].b_state = true
		end if
	next
next

is_querycolumns = as_querycolumns
return 1
end function

     
Name Owner
pfc_u_tabpg_dwproperty_srvquerymode.pfc_propertyapply pfc_u_tabpg_dwproperty_srvquerymode

     
Name Owner
datawindow.describe datawindow
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_dwsrv.of_getobjects pfc_n_cst_dwsrv

     
Full name
No Data

     
Name Scope
No Data