Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an Array from a Function
Message
De
29/02/2000 09:58:38
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338850
Message ID:
00339081
Vues:
27
>This brings up an interesting point (at least to me).
>
>The default behavior for parameter passing is by value unless specified. What happens when you pass an object to a function in the () like:
>something = myfunc(myobject)
>
>Is myobject passed by reference and therefore all the changes I make to it are reflected in the passed copy? Or do I have to explicitly pass it by reference using the @? Or do I have to return it after the changes are made?
>myobject = myfunc(myobject) will effectively remake the object.

The object reference is passed; any changes to the object state are reflected in the object passed (that's the whole idea of passing a this or thisform reference as a parameter.) It does not make a local copy of the object. Ifyou change properties (or add properties) the changes are made to the object you reference...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform