|
of_describe
|
|
Full name
|
pfc_n_cst_dwsrv.of_describe
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_describe(ref n_cst_dwobjectattrib[],string,string,string,boolean)
|
Name
|
Datatype
|
li_cnt
|
integer
|
li_col_count
|
integer
|
li_rc
|
integer
|
ls_objects
|
string[]
|
public function integer of_describe (ref n_cst_dwobjectattrib a_dwobject_attrib[], string as_attribute, string as_objtype, string as_band, boolean ab_visible_only);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Describe (FORMAT 3)
//
// Access: Public
//
// Arguments:
// a_dwobject_attrib A NVO Class to hold the described attributes
// as_attribute A string containing the name of the attribute
// to be described
// as_objtype The type of objects to describe (* for all)
// ( Must match the Type attribute )
// as_band The band from which to get objects (* for all)
// Valid bands:
// header
// detail
// footer
// summary
// header.#
// trailer.#
// ab_visible_only True - get only the visible objects,
// False - get all objects
//
// Returns: integer
// 1 = success
// -1 = an error occurred describing one or more of the attributes
//
// Description: Describes the specified attribute for all
// datawindow columns.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_cnt, li_col_count
integer li_rc = 1
string ls_objects[]
/* Get the count and names of columns on the datawindow */
li_col_count = of_GetObjects (ls_objects, as_objtype, as_band, ab_visible_only )
/* Describe the columns returned */
IF li_col_count > 0 THEN
/* Loop around all columns */
FOR li_cnt = 1 to li_col_count
/* Describe the column name */
a_dwobject_attrib[li_cnt].is_column = idw_Requestor.Describe ( ls_objects[li_cnt] + ".Name" )
IF Pos (a_dwobject_attrib[li_cnt].is_column, "!", 1) > 0 THEN
a_dwobject_attrib[li_cnt].is_column = "Error describing Name attribute of Column #" + String(li_cnt)
li_rc = -1
end if
/* Describe the column datatype */
a_dwobject_attrib[li_cnt].is_datatype = idw_Requestor.Describe ( ls_objects[li_cnt] + ".ColType" )
IF Pos (a_dwobject_attrib[li_cnt].is_datatype, "!", 1) > 0 THEN
a_dwobject_attrib[li_cnt].is_datatype = "Error describing ColType attribute of Column #" + String(li_cnt)
li_rc = -1
end if
/* Describe the passed attribute */
a_dwobject_attrib[li_cnt].is_value = idw_Requestor.Describe ( ls_objects[li_cnt] + "." + as_attribute )
IF Pos (a_dwobject_attrib[li_cnt].is_value, "!", 1) > 0 THEN
a_dwobject_attrib[li_cnt].is_value = "Error describing " + as_attribute + " attribute of Column #" + String(li_cnt)
li_rc = -1
end if
NEXT
ELSE
/* Single column to describe */
/* Describe the column name */
a_dwobject_attrib[1].is_column = as_objtype
/* Describe the column datatype */
a_dwobject_attrib[1].is_datatype = idw_Requestor.Describe ( as_objtype + ".ColType" )
IF Pos (a_dwobject_attrib[1].is_datatype, "!", 1) > 0 THEN
a_dwobject_attrib[1].is_datatype = "Error describing ColType attribute of " + as_objtype
li_rc = -1
end if
/* Describe the passed attribute */
a_dwobject_attrib[1].is_value = idw_Requestor.Describe ( as_objtype + "." + as_attribute )
IF Pos (a_dwobject_attrib[1].is_value, "!", 1) > 0 THEN
a_dwobject_attrib[1].is_value = "Error describing " + as_attribute + " attribute of " + as_objtype
li_rc = -1
end if
END IF
/* If any script failed, the Return Value will be -1 since li_rc is never reset. */
Return li_rc
end function
Name
|
Owner
|
datawindow.describe |
datawindow
|
systemfunctions.pos |
systemfunctions
|
systemfunctions.string |
systemfunctions
|
pfc_n_cst_dwsrv.of_getobjects |
pfc_n_cst_dwsrv
|