of_getmenureference


pfcwnsrv.pbl   >   pfc_n_cst_menu   >   of_getmenureference   

Full name pfc_n_cst_menu.of_getmenureference
Access public
Extend of integer
Return value integer
Prototype public function integer of_getmenureference(ref menu,string,ref menu)

Name Datatype
No Data

Name Datatype
lb_found boolean
li_cnt integer
li_found integer
li_limit integer
lnv_string n_cst_string
ls_searchitem string

public function integer of_getmenureference (ref menu am_source, string as_findmenuitem, ref menu am_menureference);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_GetMenuReference
//
//	Access:  		public
//
//	Arguments:		
//	am_source			The menu that should be searched - by reference.
//	as_findmenuitem	String containing menu item to be found in the menu.
//							(eg m_editcustomer)
//	am_menureference	The menu of the last menu item in the findmenuitem string
//							passed back by reference
//
//	Returns:  		Integer
//						 1 = Found
//						 0 = Notfound
//						-1 = error
//
//	Description:  	Returns the menu reference of a menu item so properties can be assigned
//						dynamically to that item.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.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_limit, li_cnt
integer	li_found = 0
boolean	lb_found = False
string	ls_searchitem
n_cst_string	lnv_string

//Check arguments
If Not IsValid(am_source) or IsNull(am_source) Then
	Return -1
End If

If IsNull(as_findmenuitem) or (as_findmenuitem = "") Then
	Return -1
End If

ls_searchitem = lower(as_findmenuitem)

//Use recursion to go down the menu item array
li_limit = UpperBound (am_source.item)
For li_cnt = 1 To li_limit
	If ls_searchitem = lower( am_source.item[li_cnt].classname() ) Then
		am_menureference = am_source.item[li_cnt]
		li_found = 1
//		lb_found = True
	Else
		If li_found > 0 Then Continue
//		if lb_found then continue
		li_found = of_GetMenuReference(am_source.item[li_cnt], as_findmenuitem, am_menureference)
	End If
End For

Return li_found 
//Return lb_found
end function

     
Name Owner
pfc_n_cst_mru.of_addmenubarline pfc_n_cst_mru
pfc_n_cst_mru.of_restore pfc_n_cst_mru
pfc_n_cst_mru.of_updatevisuals pfc_n_cst_mru
pfc_n_cst_menu.of_getmenureference pfc_n_cst_menu

     
Name Owner
powerobject.classname powerobject
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_menu.of_getmenureference pfc_n_cst_menu

     
Full name
No Data

     
Name Scope
No Data