May 22, 200421 yr I've seen a few discussions on window management in FMP7, but haven't found an answer to this question: What is the best way to check if a window is already open, so that you don't open another just like it? The best I can figure is to create a loop to parse WindowNames with LeftValues, in conjunction with an If / Else / End if section. Is there a more simple way to do this? Thanks Chris
May 22, 200421 yr Not sure it answers your question, but this thread has a discussion about this: http://www.fmforums.com/threads/showflat.php?Cat=&Board=UBB15&Number=101591&Forum=All_Forums&Words=windownames&Searchpage=0&Limit=50&Main=101041&Search=true&where=bodysub&Name=&daterange=1&newerval=2&newertype=m&olderval=&oldertype=&bodyprev=1#Post101591
May 22, 200421 yr Author Yes, that is a great thread and several times it mentions "check to see if a window is open", but never specifically states how. I've almost got the script I mention above to work but it seems overly complex for what it does. I'm just wondering if there is a more simple way to do it -- something I'm overlooking. Thanks
May 22, 200421 yr I'm sure I read more about this somewhere. This was the general idea: If you use a consistent naming scheme for your windows, like: "MyTable: LayoutName", then when adding a new window you can check if there is already an instance of a window before creating a new one. If [ PatternCount(WindowNames, "MyTable") //go into more datail if needed. ] #Window already exists. Else #Create New Window End If You may have to rename windows in navigation scripts to make everything work out.
May 22, 200421 yr Author Aha! PatternCount was the missing piece. I knew there was something simpler than using LeftValues and loop counter based on the number of open windows. I'll post the whole script here when I've got it working. The more I learn the more I see how much there is left to learn. Thank you! Chris
Create an account or sign in to comment