Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

The following is supposed to look for and close any windows belonging to the open database when the main window is closed. I’m sure I’ve tested it successfully, but now it goes into a never-ending loop.

Loop

Exit Loop If [$WindowCount = 0]

If [ValueCount (WindowNames (Get(FileName))) ≥ 1]

Set Variable [$WindowCount; ValueCount (WindowNames (Get (FileName)))]

Close Window [Current Window]

End If

End Loop

If I make the third line:

If [ValueCount (WindowNames (Get(FileName))) + 1 ≥ 1]

it closes the frontmost window leaving any others open.

If I create a field with the unstored calculation:

ValueCount (WindowNames (Get(FileName)))

I get ‘0’

Where am I going wrong? Is there a better way to do this?

Use the loop to close all windows except for the last one. Then exit the loop and close that one as the final step.

If all the windows are closed, the what file is the script running in?

Why not just Quit?

If there is more than one database (solution) open then quit will annoy the !@#$ out of the user because they have just been dumped back to the desktop, and they now have to go back and open all their other databases again.

I use this loopy thing so that users can open as many windows as they want, but if they close the "main" window then all the other windows get closed too.

Well, there was no mention of another open database.

Yes, that seems to be the assumption that many developers* have: that THEIR database is the only one the user will have open. :D

* Present company excepted, naturally.

Loop

Exit Loop If [$WindowCount = 0]

If [ValueCount (WindowNames (Get(FileName))) ≥ 1]

Set Variable [$WindowCount; ValueCount (WindowNames (Get (FileName)))]

Close Window [Current Window]

End If

End Loop

You're setting your $var before the Close Window. Switch the two steps and remove the uneccessary If[] statement.

  • Author

Thanks for all contributions. As guessed, I can't use 'quit'. I combined the two suggestions and got there with...

Loop

Exit Loop If [$WindowCount = 1]

Set Variable [$WindowCount; Value: ValueCount (WindowNames (Get (FileName)))]

Close Window [Current Window]

End Loop

Close Window [Current Window]

Cheers

Yes the trick is to leave the last window open, exit the loop, then close the window. :D

I don't see why a simple:

Loop

Close Window

End Loop

wouldn't work.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.