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.

Omit not Omiting???

Featured Replies

Hi

I have a script that runs on the current found set:

Goto first rec

Loop

If (sys_id>1000)

 Omit rec

End if

goto next rec (exit after last)

End loop

Sys_Id is calculated unsorted field (un-changeable).

The problem is that some record are still not omited.

This is a logical step and I don't understand WHY it is "skipping" records.

I have to run the script 6-10 time to get rid of all the "bad" records.

Any Ideas?

P.S

I don't want to use "find" because it is tooooooo long.

Hi XTrim,

This is because your script always jumps to the next record, which it does not have to do when a record is omitted.

So it should be something like:

Goto first rec

Loop

If (sys_id>1000)

Omit rec

else

goto next rec (exit after last)

End if

End loop

hope this helps,

regards,

Ernst

  • Author

OFCOURSE !!!!!!!!crazy.gif

Now This is much more logical... smirk.gif

Tnx Dude... grin.gif

The way I avoid this is to start at the last record and then each time through the loop Go to Previous record. That way you don't need the else construct.


Go to Record/Request [Last]

Loop

  If [some Condition]

    Omit Record

  End If

  Go to Record/Request [Previous, exit after first]

End Loop

Hi Bob,

Sorry to be such a bastard, but your construction goes wrong at the 'top' record when ALL records are to be be omitted.

When the script has omitted the record before the 'top' record, the 'goto previous record' step makes the loop exit, so the 'top' record does not get omitted.

Further, though it seems that the 'else' scriptstep adds a line of code, the actual script runs faster. This is because with the 'else' construction each loopcount does either an 'omit' or a 'goto' step, whilst the other construction does always do a 'goto' step PLUS sometimes an 'omit' step.

Again, sorry to be such a pain. And no pun intended...

All the best,

Ernst.

As a matter of fact, I'm also using this structure when I want to omit some records.

See the test file. It omits all records with "RAGNO". Actually, in the definitive file, the name is set by a global.

TEST.fp5.zip

Ernst, no problem. I remember having a problem when the top two records had to be omitted, but thought that it occurred in an older version and was fixed in later versions. So, it's good that you pointed it out.

Hi Ugo,

Try to make your TEST databse omit both 'RAGNO' and 'ATLAS CONCORDE' and you'll see what I mean.

Regards,

Ernst.

Hi Enst,

Well, as the records in there are either ATLAS CONCORDE or RAGNO, I'd be omitting all records with this kind of script !

With a record count = 0 and the classic message "create a new record", the user would be stuck for long time, as my solution is portal based (selfjoin).

Even a button couldn't be activated....so I discovered a big script hole in my file structure.

Though, I've added a record with ERNST and triggered the script again. No matter that ERNST bE the first or last record, both RAGNO and ATLAS CONCORDE where omitted. When looking for Omitting ERNST, no matter if ERNST was first and second records. They were omitted also.

Hmm...What am I missing here ?

Hi Ugo,

>>Well, as the records in there are either ATLAS CONCORDE or RAGNO,

>>I'd be omitting all records with this kind of script !

The point that I'm making is that the script does NOT omit all records.

Try it! But remember to delete the 'Ernst' record before you try...

The 'No records Present' situation that you would end up with when the script would work correct is one of those strange Filemaker 'features' that have astonished me for long... But that's another story/thread.

Regards to all,

Ernst.

Yes Ernst, I know.

The "this kind of script" was referencing yours. Hopefully, mine doesn't omit all records or I would be in great problem because of this 0 records "locker".

I got your point.

I was just wondering about Bob's saying it doesn't omit the last 2 records...because it surely does.

OK, never mind, I keep that if I'd be omitting, I'd use yours but would control that I'm not ending with a 0 record.

Thanks.

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.