Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter clear
Message
From
16/10/2004 18:11:57
 
 
To
16/10/2004 14:40:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00951906
Message ID:
00952015
Views:
10
>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.
>
>cheers
>
>
>>Hi Jim
>>
>>That's an interesting point of view. I don't believe the filter is holding anything in scope. I believe the filter is set but doesn't do anything until record movements are attempted.
>>
>>To prove that, I whipped up a little code.
>>
>>
>>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")
>>
>>SET FILTER TO cField1 = m.loObject.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 etc.
>>
>>
>>>Just a theoretical question here, Mike...
>>>
>>>IF a filter was using a Object.Property.Value then would it not be impossible for the object to go 'out of scope' on the basis that the filter would be holding a reference to the object?
>>>
>>>cheers
>>>
>>>
>>>>Hi Mohammed
>>>>
>>>>Never SET FILTER using object.property values. If the object (or form) goes away or goes out of scope, the filter will fail. Also filter is slower with property values. Use constants via macro substitution or memory variables.
>>>>
>>>>>hi all,
>>>>>
>>>>> i need to change this statments to somthing more activeate
>>>>>(without error message filter cleared).
>>>>>
>>>>>SELECT mstr
>>>>>LOCATE FOR BILLNO=THISFORM.TEXT1.VALUE .AND. DATEIN=THISFORM.TEXT2.VALUE
>>>>>IF FOUND()
>>>>>SET FILTER TO BILLNO=THISFORM.TEXT1.VALUE .AND. DATEIN=THISFORM.TEXT2.VALUE
>>>>>
>>>>>
>>>>>
>>>>>thanks
>>>>>
>>>>>m.qasem
Previous
Reply
Map
View

Click here to load this message in the networking platform