Skip 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.

Stuck In An Endless Loop

Featured Replies

Hi,

Does someone have an example of a looping script they can point me to so I can try to learn, I did a search but could not find anything close that will delete records.

This weekend I was trying to create a script that will delete all records that are more than a year old, and all I can manage to do is delete one record and then I have to Ctl Alt Delete so I can kill FM because I get stuck in an endless loop.

James

Edited by Guest

Ranger

It would be easier to do a find for all the records a year older and then delete them as a found set. If you have a field to search on try something like this.

enter find mode

set field (input field; search field)

preform find

show custom dialog

"is these the records you want to delete?"

If (last message choice = 1

Delete all records

show all records

else

show all records

goto wherever

Hope this helps

Lionel

Do not forget to error trap.

Without seeing your script, I can only guess that it either doesn't move forward in one of its branches, and/or you haven't checked the 'Exit after last' option when moving to the next record.

Speaking generally, any time you go into a loop, your first thought should be how to exit it.

  • Author

Thanks everyone for the info...it seems that my foulup was in the exit. This was my first attempt at a loop and I was just poking buttons hoping I could get the script set correctly, but my exit was the problem.

Now another question...is it it better do do a multi-delete via a scripted loop or by a find like the Bear showed?

Thanks for the assist.

James

In this case, it would make more sense to just find the records and then delete. No need to waste processing time with a loop when it could be done with a few script steps. With a loop each record has to be tested with your loop criteria. With a find it will do the search one time.

To loop or not to loop... it depends on the problem you're trying to solve, James. If it's exactly as stated ("delete all records that are more than a year old"), Bear's solution would be more efficient.

  • Author

Thanks,

I try that one as well, never can have too many options.

James

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.