>For example I want to Remove All objects on a form, I was trying to do something like:
>
>FOR EACH oControl IN ThisForm.Controls
>ThisForm.RemoveObject(oControl.Name)
>ENDIF
>Of course it's not working and I'm not suprised, but it's very interesting how this thing suppoused to be to get it work.
Oshibka... you should do
ThisForm.RemoveObject(oControl)
But then, it won't work either, because you're going through an array and killing its elements on the way, so somewhere halfway it will try to reference an element which doesn't exist anymore. You should do a trick like this:
do while thisform.controlcount>0
ThisForm.RemoveObject(thisform.controls[thisform.controlcount])
endd
This way you're always shooting at the last one in the list, and just waiting for the list to get exhausted. You could shoot at the first one, just the same; any other number may vanish during the process.