Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local vs Private Parameters
Message
 
 
À
16/04/2007 13:02:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01216334
Message ID:
01216346
Vues:
21
>>>It appears that creating a function via
>>>
FUNCTION myFunc (p1 AS String, p2 AS Int,...etc)
>>>creates the paramaters as Local variables.
>>>
>>>Using the same syntax, is there an option somewhere that would allow them to be created as PRIVATE????
>>>
>>>Thanks......Rich
>>
>>I thought it would create them as private (guess I was wrong). Using Parameters vs LPARAMETERS statement gives you more control.
>
>Yeah, I know that. Unfortunately there are a couple of hundred little modules using this syntax and I was hoping to be able to convert them without having to dig through them all.
>
>That being said, maybe it's better to check them all since a couple of the modules might really need the local versions.

Why would you want parameters to be private? I guess in most situations you would prefer to have them local, so the default behavior is correct to make the parameters local. In rare cases where you do need them private you should use PARAMETERS approach.

You can also always declare private variables in the function and assign parameters to them. Extra step, of course...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform