Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finally !! How to safely release objects in a Control Ar
Message
From
14/12/1996 10:45:55
 
 
To
11/12/1996 17:18:57
Paul Wei
Fib, State of Michigan
Lansing, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00014854
Message ID:
00015127
Views:
37
>>I discover how to deal with control arrays, and get rid of them in a safe way:
>>
>>If you create an array property in your form, i.e.
>>THISFORM.aObjs[1]
>>
>>and then redimension the array for adding objects with AddObject(), i.e.
>>
>>DIMENSION THISFORM.aObjs[3]
>>THISFORM.AddObject("THISFORM.aObjs[1]","CommandButton")
>>THISFORM.AddObject("THISFORM.aObjs[2]","CommandButton")
>>THISFORM.AddObject("THISFORM.aObjs[3]","CommandButton")
>>
>>The code for releasing those objects, acording to MS, is doing a redimension to the array. But you can't set the array to 0 objects !!. And, with the command DIMENSION THIS.aObjs[1], you are just releasing 2 objects. If you store a .NULL. in the element 1, you are NOT releasing the object 1.
>>
>>And sometimes, when you try to release the form, it won't close.
>>
>>To avoid this, ALWAYS add the objects beginning at the element 2. Then, to release the objects, just redimension the array back to 1 element.
>
>Have you tried to store .F. to the object array? I use:
>
> store .F. to thisform.aObjs
>
>in my methods.
>
>Paul

Yes, i did.
But i found that some forms won't close after that.

Nelson
Previous
Reply
Map
View

Click here to load this message in the networking platform