of_scanwindow


pfcapsrv.pbl   >   pfc_n_cst_security   >   of_scanwindow   

Full name pfc_n_cst_security.of_scanwindow
Access public
Extend of integer
Return value integer
Prototype public function integer of_scanwindow(window)

Name Datatype
No Data

Name Datatype
aw_window window
li_cnt int
li_menu_cnt int
li_menu_idx int
li_rc int
ll_row_cnt long
lm_menu_list menu[]
lm_win_menu menu
ls_name string
ls_win_name string

public function integer of_scanwindow (window aw_win);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_ScanWindow
//
//	Access:  public
//
//	Arguments 
//				aw_win : window to be scanned
//
//	Returns:  Integer 
//				 1 = Success
//				-1 = error of some sort
//				-2 = database error
//
//	Description:  Scans the passed window and captures the relevant information about 
//                      all of the controls and datawindow columns on the window
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_win_name,ls_name
int li_cnt,li_menu_cnt,li_menu_idx,li_rc
menu lm_win_menu
menu lm_menu_list[]
window aw_window
aw_window = aw_win
long ll_row_cnt


lm_win_menu = aw_window.menuID
ls_win_name = lower(classname(aw_window))
li_rc = ids_updates.retrieve(is_app,ls_win_name)
// check for menu items
if len(aw_window.menuname) > 0 then
	li_menu_idx = 1
	if aw_window.menuid.text = '' then aw_window.menuid.text = 'Top Level Menu Object'
	lm_menu_list[li_menu_idx] = aw_window.menuid
	do while li_menu_idx > 0
		lm_win_menu = lm_menu_list[li_menu_idx]
		ls_name = lower(classname(lm_win_menu))
		if (not isnull(ls_name)) and (len(trim(ls_name)) > 0) then 
			if not of_FindEntry(ls_win_name,ls_name) then of_addobject(is_app,ls_win_name,ls_name,'MenuItem',lm_win_menu.text )  
		end if
		li_menu_idx --
		li_menu_cnt = upperbound(lm_win_menu.item)
		for li_cnt = 1 to li_menu_cnt
			li_menu_idx ++
			lm_menu_list[li_menu_idx] = lm_win_menu.item[li_cnt]		
		next
	loop
end if
// check for controls and datawindows
this.of_ScanControlArray(ls_win_name,aw_win.control,'')

ids_updates.setfilter("not isrownew()")
ids_updates.filter()

ll_row_cnt = ids_updates.rowcount()
if ll_row_cnt > 0 then ids_updates.rowsmove(1,ll_row_cnt,primary!,ids_updates,1,delete!)
		
ids_updates.setfilter("")
ids_updates.filter()

li_rc = ids_apps.update(true,false)
if li_rc >= 0 then li_rc = ids_updates.update(true,false)
if li_rc < 1 then
	rollback using itr_trans;
	if itr_trans.sqlcode <> 0 then return -2
	return -1
else
	commit using itr_trans;
	if itr_trans.sqlcode <> 0 then return -2
	ids_apps.resetupdate()
	ids_updates.resetupdate()
	return 1
end if
	
end function

     
Name Owner
No Data

     
Name Owner
datastore.filter datastore
datastore.resetupdate datastore
datastore.rowcount datastore
datastore.rowsmove datastore
datastore.setfilter datastore
datastore.update datastore
systemfunctions.classname systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.len systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_security.of_findentry pfc_n_cst_security
pfc_n_cst_security.of_scancontrolarray pfc_n_cst_security
pfc_n_cst_security.of_addobject pfc_n_cst_security

     
Full name
No Data

     
Name Scope
No Data