0 Replies Latest reply on Oct 8, 2015 5:29 AM by lijnbach

    Closing to many windows if not using script debugger

    lijnbach

      Hello everybody,

       

      I have a situation in FMPA 14, using Mac OSX 10.11.1

       

      This is the case;

       

      Is some situation I have multiple (dialog) windows open. (between 2 and 4). (Accept the first window, that is a normal document window).

       

      In the last (dialog) window, the user can decide to navigate to another LayOut with the appropriate information. Depending of the situation, the system has to close a number of dialog windows. (A different number of windows, depending of the situation). I wrote this script to close the dialog windows;

       

      Set Variable [ $WindowNames ; Value: WindowNames ]

      Set Variable [ $NumberWindows ; Value: ValueCount ( $WIndowNames ) ]

      Set Variable [ $Counter ; Value: 1 ]

       

      Loop

           SelectWindow [ Name: GetValue ( $WindowNames ; $Counter ) ; Active database ]

           Close Window [ Active Window ]

           Set Variable [ $Counter ; Value: $Counter + 1 ]

           # Exit Loop if there if all windows are closed except the last window

           Exit Loop if [ $Counter = $NumberWindows ]

           Exit Loop if [ Get (WindowName) = GetValue ( $WindowName ; NumberWindows ) ]

      End Loop

       

      I used 2 Exit Loops because it wasn't working with the first exit loop, FMP closed all windows. Also with the second exit loop FMP keeps closing all the windows.

       

      So, I went tot the script debugger, and guess what? It worked as expected. (And no errors occur in the script debugger). Closing the script debugger, and FMP closes all the windows again.

       

      Is it a bug, or am I missing something?

       

      Thanks in advance,

       

      Hans Lijnbach.