Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to store functions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00453555
Message ID:
00453558
Vues:
31
>I've got a form with a date field. This date field needs to be converted to an OLE Date, and I've got a nice little conversion program that does that, which I call as a function. However, as soon as I define a function within a form method and try to close the method I get the following message:
>
>"Methods and Events cannot contain nested procedures or class definitions."
>
>So, I made another method with my conversion function...but then I also found that I have a leapyear function within the conversion function....and before adding another method to the form, I began thinking, maybe this isn't a "best practice".
>
>So, what are my options?
>
>1. I can place the function as .prg file in my source folder for the project
>or
>2. I can define new methods for the form, till the cows come home.
>
>or ???
>
>Since this is a single purpose thing, I'd really like to keep it with the form (maybe even with the field).
>
>any ideas here?
>
>thanks... Larry

I recommend making each individual function/procedure in the prg a separate method in the class or form. Calls to them will, of course, need to be changed from simply MyFunction() to object.MyFunction()
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform