Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving Popup names from menu file.
Message
 
 
To
02/01/2001 12:18:00
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00458411
Message ID:
00458547
Views:
25
>Thanks for your help Mark, but is that the only way?
> I mean, for what I intend, I don't know if that will sort the problem out.
>My purpose is to create a program that (when a menu is active) will give me a list of all the bars within all the popups of that menu, so that then, I can specify for every user if he will have access to that menu option, or not.
> I know I'm pushing it, but I'm really desperate, and retrieving the popup names seems to be the only way of doing it. And besides, I could store all the Menu options into a dbf, updating it every time I changed the menu, and work from there, but that leaves too many loose ends...

Unless you specify the name of the popup in the menu designer, VFP derives it from the prompt of the pad. The following code will return the name of the popup for user-defined menu items:
for lxx = 1 to cntbar("_msysmenu")
	lcpadprompt = prmpad("_msysmenu",getpad("_msysmenu",lxx))
	
	* build a string with disallowed characters as VFP strips these out of the name
	lcdisallowed = space(0)
	for lyy = 1 to 47
		lcdisallowed = lcdisallowed + chr(lyy)
	endfor
	
	for lyy = 58 to 64
		lcdisallowed = lcdisallowed + chr(lyy)
	endfor

	for lyy = 91 to 96
		lcdisallowed = lcdisallowed + chr(lyy)
	endfor

	for lyy = 123 to 255
		lcdisallowed = lcdisallowed + chr(lyy)
	endfor

	lcpopname = chrtran(lcpadprompt,lcdisallowed,"")
	? lcpopname
endfor
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform