Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you put a variable on a MENU OPTION?
Message
From
15/05/1998 03:10:57
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
14/05/1998 12:15:18
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00099099
Message ID:
00099672
Views:
27
>>Are you using the menu builder?.
>>Do you want the _Tally value to be displayed when the user drops down a menu item or, as a response to the user selecting a menu item.
>>Are we talking about a menu bar (top level) menu item, or a sub menu item?
>---
>yes - vfp50
>>Are you using the menu builder?.
>
>when the user drops down the menu. the _tally must be displayed on the menu when the user first goes into the program before the menu option is picked.
>>Do you want the _Tally value to be displayed when the user drops down a menu item or, as a response to the user selecting a menu item.
>
>a sub menu item that calls a procedure.
>>Are we talking about a menu bar (top level) menu item, or a sub menu item?

So, my original message still stands.
1) You need to redefine the menu prompt (the text) each time your value of _Tally changes. The menu option cannot be made to automatically update itself.

2) to make the change you need to issue a DEFINE BAR command every time you need the text of the menu item to change.

3) To be able to issue the DEFINE BAR command, you need to know the name of the PAD that is used to define the menu bar item (top level) and the number of the BAR on the dropdown menu that contains your text.
When you use the menu builder, these two values (pad and bar) are randomly generated. You must set known values inside the menu builder.
Edit your menu, then click on the options button for the top-level menu item. There is a field for PAD NAME, enter a name (e.g. padTop). Now go down to you submenu and click on the options button against the item that will contain the changing text value. There is a field for BAR#, enter a number (e.g. 1).

Now you know the values for Pad and Bar that will be used whwn your menu is generated and run.

Now, whenever you need the number on the menu to change, you can issue the command (where _Tally holds the new number) :-
DEFINE BAR 1 OF padTop PROMPT "Record count is " + LTRIM( STR( _Tally))

Hope it helps
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform