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.

Loop crashes fmp8

Featured Replies

Hi

I have a very simple loop. The layout has 110 fields and the script copies the first field and pastes into the next field. It loops 55 times using a counter and exits.

It works fine with FMP8 advanced, but when I use fmp8 it crashes.

Privledges are the same.

Any ideas?

My only experience with crashing FMP and looping scripts is if you are using a recursive method i.e. the script is calling itself.

Are you sure this is the best way to copy the data?

Consider using the "Replace Field Contents" script step. It is significantly faster and will simplify your script.

I doubt it is a privilege thing.

It works fine with FMP8 advanced, but when I use fmp8 it crashes.

I can't believe :P

Please, attach your file !

... try downloading a patch for fm 8...

~genx

  • Author

Ideal, I've heard about using calculated replaces, but how would you apply it to replace a loop?

Ray, my file is too big to post.

It crashes fmp8 during remote and when its running independently on fmp8. version is 8.02

  • Author

Here is my script:

Go to Field [ Copy_Last~Audit::q1 ]

Set Field [ Preferences::gCounter; 55 ]

Loop

Copy [ ] [ Select ]

Go to Next Field

Set Field [ Preferences::gCounter; Preferences::gCounter-1 ]

Paste [ ] [ Select ]

Go to Next Field

Exit Loop If [ Preferences::gCounter = 1 ]

End Loop

Set Field [ Audit::Annual; "X" ]

... try using variables instead... secondly, if its the same value to 55 fields, your copy shouldnt be in the loop... and for the same reason neither should the first goto next field...

~genx

Put pauses in your script after every step. You need to be able to see that the copy/paste is working and that your global is decrementing

Is the field tabbing sequence correct? Go To Next field relies on that.

You say taht FMP8 crashes - are you sure it isn't just stuck in an infinite loop?

... thats what i thought the problem may have been, but then why would it work in fmpa? and then i was going to recommend debugging... but it works in fmpa so...

~genx

  • Author

Each value copied is different. Basically its a previous report that is copied field by field for a new report. I can't duplicate the record because I only need some of the data.

When I say it crashes, it closes the file and closes filemaker pro 8. It happens about a half second after the script is called so I dont see how could loop infinetely.

The wierd thing is that it works fine on fmp8a.

.. ok well this is my last idea... try opening and hosting the file on one machine on fmpa and then opening the file remotley on a machine with fmp8 installed and see what happens... then if that doesnt work, try running the script in fm7dev and if it doesnt work debug... cause like i said im running out of ideas... finally.. if nothing works, post a sample file and let someone else try running it on fmp8, it might just be your copy of fmp8... in which case you could also try a re-install

~genx

... try using this instead...

Go to Field [ Copy_Last~Audit::q1 ]

Set Field [ Preferences::gCounter; 55 ]

Loop

SetVariable[$Contents ; Get(ActiveFieldContents)

Go to Next Field

Set Field [ Preferences::gCounter; Preferences::gCounter-1 ]

Insert Calculated Result [ $Contents ]

Go to Next Field

Exit Loop If [ Preferences::gCounter = 1 ]

End Loop

Set Field [ Audit::Annual; "X" ]

i just figure we should try substitute the copy and past functions for something else, see if it helps...

~genx

Test the script step by step as I suggested - then you will find out what the problem is.

You can't fix it until you know what the problem is.

Hmmm, pausing is actually quite a good idea, try that.

~Genx

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.