Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an Array from a Function
Message
De
29/02/2000 10:24:55
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338850
Message ID:
00339099
Vues:
28
>The default behavior for parameter passing is by value unless specified. What happens when you pass an object to a function in the () like:

You only pass an object reference, wether you pass the parameter by Value or Refrerence. The object reference is a pointer. Consider this as an explanation (BTW, I've never tried this before I could be way off, but youb made me think about it)

This would be the difference between passing an object refrence by value or reference:
local oObj
oObj = createobject(oFirst)

?oFirst.Name
ChangeObject(oFirst)
?oFirst.Name
ChangeObject(@oFirst)
?oFirst.Name

function ChangeObject
     lparam toObj
     toObj = createobjet(oSecond)
emd function

define class oFirst as custom
     name = 'First'
enddefine

define class oSecond as custom
     name= 'Second'
enddefine
I don't have VFP by, does this give:

First
First
Second

?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform