Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining Whether A Menu Exists Or Not
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00605682
Message ID:
00606321
Views:
19
>>Hello all,
>>
>>I've got a "File" menu in my program that I re-build whenever a new user logs in. Very rarely i'll get the error "Menu has not been defined with DEFINE POPUP", when I do a CNTBAR("File"). It doesn't have regularly however. What I'd like to do is just determine if the file HAS been defined, and if it hasn't, skip that code. I searched the help files, but couldn't find a command to do this. Any ideas? Thanks!
>
>See Forum: Visual FoxPro Category: Troubleshooting Title: Re: No such menu item Thread #510194 Message #510210

Hrm. Well the problem is I seem to be getting the error ON the CNTBAR command. here's the code:

FOR lnxxx = CNTBAR("File") TO 1 STEP -1 && Remove File Pull Down Menu
RELEASE BAR GETBAR("File", lnxxx) OF FILE
NEXT

The "For" line gives me the error. If I change it like this:

If CNTBAR("File") > 0
FOR lnxxx = CNTBAR("File") TO 1 STEP -1 && Remove File Pull Down Menu
RELEASE BAR GETBAR("File", lnxxx) OF FILE
NEXT
EndIf

Do you think that will fix the error? I can't duplicate the error consistently, otherwise I'd just test it.. Thanks for your input.
Scott
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform