General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only