Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an array property by reference
Message
From
17/11/1997 07:59:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00060585
Message ID:
00060628
Views:
25
Tom,

What do you get if you pass the array with the "@" character prefixing it?

Good Luck,
Jim N

>I'd like to use one of my standard functions that receives an array and searches only one column. But when I try to pass my array by reference, it gives me the messge "Alias THIS not found".
>
>I wrote a little test program which I have attached. Is this a FoxPro bug? I would appreciate any explanation why this doesn't work the way I think it should, and any suggestions for workarounds. I have one in the program but I'm not crazy about it.
>
>TOM'S TEST PROGRAM
>----------------------------------------
>*** Why can't I pass a member array to a procedure by reference
>
>otest = createobject("MYCLASS")
>otest.DoIt()
>return
>
>*-------------------------
>procedure MYPROC(taARRAY)
>wait window taARRAY[2]
>return
>
>*===========================================
>define class MYCLASS as custom
> dimension aARRAY1[1,3] = .f.
>
>procedure DoIt
> this.aARRAY1[2] = "Array 1 element 2"
> *-- The following works
> dimension laARRAY[1,3]
> = acopy(this.aArray1, laArray)
> ? MYPROC(@ laArray)
> *-- But this fails with message "Alias THIS not found"
> ? MYPROC(@this.aArray1)
> *-- This also fails with the same message.
> = this.MYPROC1(@this.aArray1)
> *-- But this works fine
> = this.MYPROC2()
> return
>
>procedure MYPROC1(taARRAY)
> wait window taARRAY[2]
> return
>
>procedure MYPROC2
> wait window this.aARRAY1[2]
> return
>
>enddefine
>*===========================================
>
>*** Thanks,.... Tom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform