General information
Category:
Coding, syntax & commands
I'm confused as to what's happening here with this code that is a little different that Rick S.'s code. I'm making the original array a LOCAL and I rebuild the loObj a second time and use "aItems[2]" instead of "aItems[1]".
When I run it through the debugger and step into the CallMethod and examine all the variables "loObj" in that method, I got .aItems[1]='Rick' and .aItems[2]='Rick'. I was expecting to see 'Markus' to be in .aItems[2] during in the 2nd call.
local laItems[2],x
laItems[1] = "Rick"
laItems[2] = "Markus"
*******************************First Call
loObj = CREATE("Empty")
ADDPROPERTY(loObj,"aItems[1]",laItems)
SET STEP ON
x= CallMethod(loObj)
?x
loObj = .null.
release loObj
*******************************Second Call
loObj = CREATE("Empty")
ADDPROPERTY(loObj,"aItems[2]",laItems)
SET STEP ON
x= CallMethod(loObj)
?x
RETURN
FUNCTION CallMethod(loObj)
local x as Object
x = loObj.aItems[1]
try
?x
catch
endtry
return x
*return loObj.aItems[1]
ENDFUNC
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