Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object not found
Message
De
29/07/2005 18:47:34
 
 
À
29/07/2005 17:27:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01037164
Message ID:
01037178
Vues:
27
On a activate method for a page (4 pages on a single pageframe) I have code like

ON KEY LABEL F9 thisform.DoSomething

where DoSomething method contains

Invoice.pageframe1.page3.cmdAction.click (invoice is a form name, cmdAction is a command button)

First time I press F9 on a page everything works fine and code under command button executes. Code under command button is nothing special and strange.

Second time (and so on) pressing F9 cause fox error
"Object 'invoice' not found"


And now you know first hand why OKL's are not a very good idea. The reason is that they interrupt whatever code happens to be running at the time and execute - something that may have unpredictable results. A better idea would be to set the form's KeyPreview property to true and put code like this in the form's KeyPress() method:
IF nKeyCode = -8  && F9
  thisform.DoSomething()
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform