Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter clear
Message
From
16/10/2004 18:13:19
 
 
To
16/10/2004 17:45:33
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00951906
Message ID:
00952016
Views:
12
Sorry, Mike... try this one:
LOCAL loObject
loObject = CREATEOBJECT("Custom")
AddProperty(m.loObject,"icName")
m.loObject.icName = "Jim Nelson"

CREATE CURSOR c_SomeCursor (cField1 c(10))
INSERT INTO c_SomeCursor (cField1) VALUES ("Jim Nelson")
INSERT INTO c_SomeCursor (cField1) VALUES ("Mike Yearwood")

xx = m.loObject
SET FILTER TO cField1 = m.xx.icName
BROWSE

RELEASE m.loObject

CLEAR
DISPLAY MEMORY LIKE loObject
WAIT WINDOW "Hold down the shift key to see that the object is really gone."

*Do a record movement and it will crash.
GO TOP 
BROWSE
Is it still proper to you, considering that loObject has been released?

cheers

>>Yup, I'd say you've proved the point.
>>
>>However, see what you get when you try the following:
>>
LOCAL loObject
>>loObject = CREATEOBJECT("Custom")
>>AddProperty(m.loObject,"icName")
>>m.loObject.icName = "Jim Nelson"
>>
>>CREATE CURSOR c_SomeCursor (cField1 c(10))
>>INSERT INTO c_SomeCursor (cField1) VALUES ("Jim Nelson")
>>INSERT INTO c_SomeCursor (cField1) VALUES ("Mike Yearwood")
>>
>>xx = m.loObject.icName
>>SET FILTER TO cField1 = m.xx
>>BROWSE
>>
>>RELEASE m.loObject
>>
>>CLEAR
>>DISPLAY MEMORY LIKE loObject
>>WAIT WINDOW "Hold down the shift key to see that the object is really gone."
>>
>>*Do a record movement and it will crash.
>>GO TOP && BROWSE etc.
>>
>>
>>Now I personally do not believe that the behaviour of RELEASE in this case is proper, but it is the way it is.
>>
>
>What's improper? The value of the object's propery is copied to m.xx which is used in the filter. Did you expect m.xx to keep the object in existence?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform