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.

#Comment Interferes with Script - Bug?

Featured Replies

Hi Everyone,

I just ran into an unexpected behavior. I had the following simple script: (Condensed for typing sake)

Set Error Capture ON

Loop

Set Field (some data in the record)

Go To Record/Request/Page[Exit after last, Next]

#Look for records that fail required value validations

IF[status(CurrentError) = 509]

#Must revert the record to allow the script to continue.

Revert Record/Request [No dialogue]

End If

End Loop

Using Developer 5.5 and the Debug Script mode, when stepping through each Script Step FileMaker fails to capture the 509 error because the comment is in-between the action that causes the error and the IF that catches the error. If I move the comment out from in-between the two, it does capture the error.

Wow. A comment shouldn't mess up a script.

Yep, I agree - but FMP doesn't hold on to the generated error code for more than the next step, so its important to place your If[status(CurrentError)] step immediately after the action which could case the error.

If you don't want to do this, then you should store the error number in a global field and then check for it in a later script step by running the If step on the contents of the global field.

Trevorg is right...only the very lame-brained would execute a comment line in a debugger. I have never seen that done in any language/compiler environment (over 30 year of experience). Comments are universally ignored by the compiler or interpreter.

It is not so much that the comment is executed or that the debugger forgets the error code, it is that EVERY SINGLE SCRIPT STEP sets the error code. And there is only 1 error code register available to the Status ( CurrentError ) command. So the error code from the Find Script is valid only until the next line where another error code is set.

If you want to make the error code more persistant then use a global field. Personally I use global repeating fields for storing error codes. I then have a layout which shows them all as well as what each of them stores. This way I can see error results from my last find, import, export, sort, or whatever other function I want.

Kurt: What you say is certainly true . My point is that a comment is not and should not be an executable script step. In fact, a nice change would be for them to let us put a # in front of any line to prevent its execution, rather than having to move the statement to the bottom of the script following an Exit or Halt or deleting the statement.

I would love to have the ability to put a "#" in front of a step to prevent it from executing.

Kinda like the "rem" in DOS- for those you old enough to remember....

Jack

  • Author

That would be nice indeed!

I remember "rem" and putting a ";" in the win.ini!

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.