>>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 #
510210Hrm. 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