Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing object array
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01668317
Message ID:
01668321
Views:
53
Just to clarify you can do something like this:
DECLARE laItems[2] 

laItems[1] = "Rick"
laItems[2] = "Markus"

loObj = CREATE("Empty")
ADDPROPERTY(loObj,"aItems[1]",laItems)

? CallMethod(loObj)  &&  "Rick v2.0"
? loObj.aItems[1]     && "Rick v2.0"

RETURN

FUNCTION CallMethod(loObj)
loObj.aItems[1] = "Rick v2.0"
return loObj.aItems[1]
ENDFUNC
+++ Rick ---

>Is there a way to pass an object array by reference?
>
>
lo = CREATEOBJECT("_c")
>lo.process()
>
>DEFINE CLASS _c AS Custom
>    aArray[1] = .f.
>    
>    PROCEDURE Process
>    LOCAL laArray
>        DIMENSION laArray[1]
>SET STEP ON
>        this.update_array(@laArray)
>        this.update_array(@this.aArray)
>    ENDPROC
>
>    PROCEDURE update_array
>    LPARAMETERS taArray
>    EXTERNAL ARRAY taArray
>        taArray[1] = "test"
>    ENDPROC
>ENDDEFINE
>
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform