I'd close the windows in the other order if I were you. That way your 
count in the for-next loop doesn't get messed up. 

Like so:
For i = NumWindows() to 1 step -1


On Tue, 10 May 2005, Nabors, Steve wrote:

> I just noticed one syntax correction to make here:
> 
> For I from 1 to NumWindows()
> 
> Should be
> 
> For I = 1 to NumWindows()
> 
> Otherwise, everything the code looks fine assuming:
> A:You don't want to close everything
> B:You don't want an interactive dialog window closure
> C:You don't want to close MapInfo
> D:You don't want to reboot the machine
> E:........You just want to close any window named "Redistrict"
> ;-)
> 
> See the modification below:
> 
> Dim I as integer
> For I = 1 to NumWindows()
>       If WindowInfo(I,Win_Info_Name) = "Redistrict" then
>               Close Window WindowID(I)
>       End If  
> Next
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Krstonosic, Mladen [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 10, 2005 12:21 PM
> To: [email protected]
> Subject: RE: MI-L Close window statement
> 
> 
> Much simple code is: 
> 
> 
> Close All
> 
> 
> Regrads,
> Mladen K.
> 
> -----Original Message-----
> From: Krstonosic, Mladen [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 10, 2005 1:16 PM
> To: [email protected]
> Subject: RE: MI-L Close window statement
> 
> 
> 
> Dim I as integer
> For I from 1 to NumWindows()
>       If WindowInfo(I,Win_Info_Name) = "Redistrict" then
>               Close Window WindowID(I) Interactive    '!!!!!! Must be
> [Interactive]
>       End If  
> Next
> 
> 
> 
> -----Original Message-----
> From: Nabors, Steve [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 10, 2005 12:53 PM
> To: Alan Gunn
> Cc: [email protected]
> Subject: RE: MI-L Close window statement
> 
> 
> Either your "redistricting" window is graphical(map, layout, etc) or
> tabular(browser) most likely.
> Assuming it's the front window, you could use the following command to find
> out:
> 
> 
> Note WindowInfo(FrontWindow(),WIN_INFO_TYPE)
> 
> 
> If  it is a table or map and your window you want to close has a unique
> name, say "Redistrict", you should be able to close it using its name in the
> following code:
> 
> Dim I as integer
> For I from 1 to NumWindows()
>       If WindowInfo(I,Win_Info_Name) = "Redistrict" then
>               Close Window WindowID(I)
>       End If  
> Next
> 
> 
> Good luck
> 
> -----Original Message-----
> From: Alan Gunn [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, May 10, 2005 10:02 AM
> To: [email protected]
> Subject: MI-L Close window statement
> 
> Hello all,
> 
> I am trying to use the close window command to close a redistricting window,
> but I am having trouble. It says in the help that when you want to close
> something such as a mapper or browser, you need to include the window id.
> Would the district browser fall under browser? How do you obtain the window
> id (when I try the windowid() or the frontwindow command it doesn't
> recognize)?
> 
> Thanks for any help with this, 
> 
> Alan
> 
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com | To
> unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 16408
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com | To
> unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 16410
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 16411
> 
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 16415
> 


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16419

Reply via email to