Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Repeating piece of code
Message
De
02/04/2013 09:14:02
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01569704
Message ID:
01569715
Vues:
84
>I know that click method does not allow embedded procedures.
>
>But is there any trick to execute a small piece of code inside the method,
>calling it with Do, or other command ?
>
>It would be very useful because when you write inside a procedure it will not work,
>if inside the procedure there are lines as thisform.command1.click, etc.

I'm not exactly sure what you're asking, but in general the right way to handle a piece of code that you need several places is to create a custom method at the appropriate level and call it where you need it.

So, if you'll need this code in a number of different command buttons, add it as a custom method to your button class. If you'll need it from a number of different places in a single form, add it to the form. If you'll need it in a number places in a number of forms, add it to a form class. If you'll need it throughout your application, add it to your application class.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform