Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing form properties by reference to a procedure
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00162339
Message ID:
00162396
Vues:
22
>Indeed George,
>Objects are always passed by reference, this comes in handy when creating an object as parameter object loaded with the parameter you like.
>But I think you misunderstood me.
>I was trying to pass an object's property by reference, where Fox insists on passing it by value. something like:
>
>THISFORM.icProp1 = ''
>THISFORM.icProp2 = ''
>
> DO WITH THISFORM.icProp1, THISFORM.icProp2
>
>
>
>PROCEDURE myProcedure
>LPARAMETER tcArg1, tcArg2
>
>tcArg1 = 'Some value 1'
>tcArg2 = 'Some value 2'
>
>ENDPROC
>
>on return from this MyProcedure in the calling method. Have a look at the contents of thisform.icProp1 and thisform.icProp2.
>You will see that they DON'T contain 'Some value 1', 'Some value 2' but still contain the empty character string.

Hi Yves,

I don't know what the reason for this but the following, does work:
DO SetValue WITH ThisForm.Text1
Thisform.Text1.Refresh

PROCEDURE SetValue

LPARAMETER pobject

pobject.Value = "Foo"
RETURN
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform