Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining Whether A Menu Exists Or Not
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00605682
Message ID:
00606321
Vues:
18
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform