>>>Naomi,
>>>
>>>Usually you can not iterate with FOR EACH in any collection while adding or removing items. Your Step - 1 solution is correct, IMO
>>
>>Hmm, I'm not sure, this needs to be comfirmed. I thought "for each" should work even when adding or removing. I need to review my own FAQ again, I already switched to George's solution but it didn't help yet.
>>
>
>I can confirm if you care:) Do not add/remove with a foreach (not in VFP, not in .Net - at least documented for .Net:)
>Cetin
I do, Cetin.
Yes, now I can see that we can not use collection. I also need to re-check my FAQ.
But for some reason even
lnForms = _SCREEN.FORMCOUNT
DO WHILE lnForms > 0 AND llExit
IF PEMSTATUS(_SCREEN.FORMS(lnForms),'QueryUnload', 5)
llExit = _SCREEN.FORMS(lnForms).QUERYUNLOAD()
ENDIF
IF llExit
_SCREEN.FORMS(lnForms).RELEASE
lnForms = m.lnForms - 1
ENDIF
ENDDO
Didn't work yesterday. Do you know what may be wrong?
Appreciate your response in advance.
If it's not broken, fix it until it is.
My Blog