Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning an Array from a Function
Message
From
29/02/2000 10:24:55
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00338850
Message ID:
00339099
Views:
27
>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

?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform