of_GetRegisterableTable


pfcdwsrv.pbl   >   pfc_n_cst_dssrv_multitable   >   of_GetRegisterableTable   

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

Name Datatype
No Data

Name Datatype
lb_found boolean
li_cnt integer
li_colcount integer
li_tablecnt integer
li_tablecount integer
li_upper integer
lnv_string n_cst_string
ls_colattributes string
ls_colname string
ls_dbname string
ls_empty string[]
ls_table string

public function integer of_GetRegisterableTable (ref string as_table[]);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_GetRegisterableTable
//
//	Access:  		public
//
//	Arguments:
//	as_table[] (By Ref.)  All table belonging to the requestor which could be 
//		registered.
//
//	Returns:  		Integer
//	 The table count.
//	-1 if an error is encountered.
//
//	Description:
//	Determines all table belonging to the requestor which could be registered.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_tablecount
integer	li_tablecnt
integer	li_colcount
integer	li_cnt
integer  li_upper
string	ls_colname
string	ls_colattributes
string	ls_dbname
string	ls_table
string 	ls_empty[]
boolean 	lb_found
n_cst_string lnv_string

// Clear the reference variable.
as_table = ls_empty

// Validate required references.
If IsNull(ids_requestor) or Not IsValid(ids_requestor) Then Return -1

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

// Loop around all columns looking for dddw or ddlb columns.
For li_cnt=1 to li_colcount
	// Get the column name.
	ls_colname = ids_requestor.Describe("#"+string(li_cnt)+".Name")
	
	// Get the Table name.
	ls_dbname = ids_requestor.Describe(ls_colname+".dbName")
	ls_table = lnv_string.of_GetToken(ls_dbname, '.')
	
	// Determine if this is an new table.
	li_tablecount = UpperBound(as_table)
	lb_found = False
	For li_tablecnt = 1 to li_tablecount
		If as_table[li_tablecnt] = ls_table Then
			lb_found = True
			Exit
		End If
	Next
	If Not lb_found Then
		// Found a new table entry.
		as_table[li_tablecount +1] = ls_table
	End If
Next

Return UpperBound(as_table)
end function

     
Name Owner
No Data

     
Name Owner
datastore.describe datastore
systemfunctions.integer systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.string systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_string.of_gettoken pfc_n_cst_string

     
Full name
No Data

     
Name Scope
No Data