*-------------------------------------------------------------- *-- *-- Visual FoxPro 08.00.0000.2521 for Windows *-- *-- Works fine in Visual FoxPro 07.00.0000.9465 for Windows *-- Works fine in Visual FoxPro 08.00.0000.2021 for Windows *-- *-- Demonstrates possible access method bug when directly *-- calling a method in the returned object like so: *-- *-- THIS.uProp(1).Add("1") *-- *-- The access method gets .F. instead of 1 as it's *-- parameter value. For workarounds see below. *-- *-- Submitted by armin.neudert@ansta.de *-- 02-19-2003 08:50 pm *-- *-------------------------------------------------------------- LOCAL loX loX = CREATEOBJECT("test") loX.Test() DEFINE CLASS test AS Session oCollection = .NULL. DIMENSION uProp[1] uProp[1] = .F. PROCEDURE Init THIS.oCollection = CREATEOBJECT("TestCollection") ENDPROC PROCEDURE Test *-- Used to work in the public beta and in previous versions *-- VFP passes .F. instead of 1 as index parameter to the *-- access method. THIS.uProp(1).Add("1") *-- This way it works! LOCAL loTest loTest = THIS.uProp(1) loTest.Add("2") *-- This way it works, too! ? THIS.uProp(1).Add("3") *-- This way it works, too! LOCAL luDummy luDummy = THIS.uProp(1).Add("4") ENDPROC PROCEDURE uProp_Access LPARAMETERS tlnIndex MESSAGEBOX( "Index passed to uProp_Access: " + TRANSFORM(tlnIndex) ) RETURN THIS.oCollection ENDPROC ENDDEFINE DEFINE CLASS TestCollection AS Session PROCEDURE Add LPARAMETERS tluDummy *-- Just a dummy method ENDPROC ENDDEFINE