|
of_scandatawindow
|
|
Full name
|
pfc_n_cst_security.of_scandatawindow
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_scandatawindow(string,datawindow,string)
|
Name
|
Datatype
|
li_col_cnt
|
int
|
li_posi
|
int
|
ls_ans
|
string
|
ls_dw_name
|
string
|
ls_name
|
string
|
ls_query
|
string
|
ls_token
|
string
|
protected function integer of_scandatawindow (string as_win_name, datawindow adw_scan, string as_object);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_ScanDatawindow
//
// Access: protected
//
// Arguments : as_win_name : string; name of window
// adw_scan : datawindow ; DW to be scanned
// as_object : string; Object that owns the datawindow control; if the
// object and the wondow are the same then this parameter is blank
//
// Returns: integer : (-1: unable to open datawindow object; -2 error on object create
// otherwise the number of columns that were found
//
// Description: Scans the datawindow object and captures the information about each column
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0 Marked obsolete
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
string ls_dw_name,ls_query,ls_token,ls_ans,ls_name
int li_posi,li_col_cnt = 0
ls_dw_name = as_object + lower(classname(adw_scan))
ids_info.dataobject = adw_scan.dataobject
ls_query = ids_info.describe("datawindow.objects")
ls_query = lower(ls_query)
do while len(ls_query) > 0 // strip apart the tab seperated string
li_posi = pos(ls_query,"~t")
if li_posi = 0 then // no more tabs so take what's left of the string
li_posi = len(ls_query)
else
li_posi = li_posi - 1
end if
ls_token = left(ls_query,li_posi) // grab off the token
ls_query = mid(ls_query,li_posi+2) // skip past the tab
if len(ls_token) > 0 then
ls_ans =ids_info.describe(ls_token+".type ")
ls_ans = lower(ls_ans)
if pos(ls_ans,"column") > 0 then // is it a column?
ls_name = ls_dw_name + "."+ls_token
if not isnull(ls_name) and len(trim(ls_name)) > 0 then
ls_ans =ids_info.describe(ls_token+".dbname ") + ' : ' + ids_info.describe(ls_token+".coltype") // get the descriptive info
if not of_FindEntry(as_win_name,ls_name) then of_addobject(is_app,as_win_name,ls_name,'Column',ls_ans )
li_col_cnt++
end if
end if
end if
loop
return li_col_cnt
end function
Name
|
Owner
|
datastore.describe |
datastore
|
systemfunctions.classname |
systemfunctions
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.left |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.lower |
systemfunctions
|
systemfunctions.mid |
systemfunctions
|
systemfunctions.pos |
systemfunctions
|
systemfunctions.trim |
systemfunctions
|
pfc_n_cst_security.of_findentry |
pfc_n_cst_security
|
pfc_n_cst_security.of_addobject |
pfc_n_cst_security
|