-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of MB Software Solutions
Sent: Tuesday, January 16, 2007 10:47 AM
To: [EMAIL PROTECTED]
Subject: Re: Releasing Multiple Windows - But Not All

Jeff Johnson wrote:
> I am trying to close all windows except two and am not having much luck.
> The following code releases all of the windows except the two I want to
> leave open and the _screen.activeform.  I even tried releasing the
> _screen.activeform first, but it still leaves it open.  I also tried
> ACTIVATE SCREEN and _SCREEN.Show().  Likewise, I tried frmtimer.activate
> making it the active form.  I can't seem to make the active form release. 
>
>  
>
> LnForms = _SCREEN.FormCount
>
> DO WHILE lnForms > 0
>
>   IF !(UPPER(_SCREEN.Forms(lnForms).name) $ 'CAPPTOOLBARBASE~FRMTIMER')
>
>     llSuccess = _SCREEN.Forms(lnForms).QueryUnload()
>
>     IF llSuccess
>
>       _SCREEN.Forms(lnForms).Release()
>
>     ENDIF
>
>   ENDIF
>
>   lnForms = lnForms - 1
>
> ENDDO
>
>  
>
> Any ideas?
>   

Just a WAG, but why not try and loop backwards?

For MyLoop = MyCount to 1
   * code to release the form(MyLoop) instance
endfor

Perhaps it's no different?

-- 
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"



Hey Michael:  The loop above does start at the end and go backwards.  That
seems to be the only way due to the .forms(x) changing when you release a
form.  It is the last forms activated .forms(lnforms) that will not release.


Jeff

Jeff Johnson
[EMAIL PROTECTED]
623-582-0323
Fax 623-869-0675


--- StripMime Report -- processed MIME parts ---
multipart/signed
  text/plain (text body -- kept)
  application/x-pkcs7-signature
---


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to