Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
For each doesn't release all forms?
Message
 
 
To
18/07/2007 07:56:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01241310
Message ID:
01241491
Views:
49
>>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform