Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable defenition
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00354722
Message ID:
00354745
Vues:
18
>>>Hi
>>>How and where can i declare a variable to be visible any where in my form
>>>In clipper we use to declare it Private in the top of the main prg
>>
>>You can do the same in VFP, but that is not the way to handle this. The right OOP way is to add a property to your form (it may be an array property)
>
>Hi Nick
>I know how to define a array property but how can i passe by reference this array to a function outside the form. my function is in a .prg This prg hold some function use from other form.
>
>I hope im clear enough my english is not good as i wish.
>
>Thank
>
>Benoit

You can pass the whole form as an object to your function, and it will handle your array like

Say, code in some form method is:

IF something
myFunctionInPRG(thisform)
ENDIF

* myfunctioninprg.prg
LPARAMETER loCaller
loCaller.MyArrayProperty[1] = 1
loCaller.MyArrayProperty[2] = 5
loCaller.MyArrayProperty[3] = 42
RETURN
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform