Jump to content
Server Maintenance This Week. ×

Looping through found records


This topic is 6481 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hey all you FileMaker...ers

Is there a more efficient way to loop through found records than the following:

Go to Layout [Layout1(Layout1)]

Set Variable [$ItemNum;Value:Layout1::Item Number]

Go to Layout [Layout2(Layout2)]

Enter Find Mode []

Set Field [Layout2::Item Number;$ItemNum]

Go To Record [Last]

Set Variable [$LastLot = Layout2::Lot Number]

Loop

.

.

.

Exit Loop If [$LastLot; Value:Layout2::Lot Number]

End Loop

Either that or is there a way for the script to find out how many records were found?

Thanks a lot,

M

Edited by Guest
error in code
Link to comment
Share on other sites

Since you've omitted the contents of the Loop, it's hard to tell what you're trying to accomplish here.

Also, what are the TOs (table occurences) "Layout1" and "Layout2"? Are they related? If so, how?

Either that or is there a way for the script to find out how many records were found?

The function Get(foundcount) will tell your script how many records are in the found set.

Link to comment
Share on other sites

Ender,

Yeah, I realize that it's pretty vague what I'm doing here (I try not to be so vague, but the entire loop is quite lengthy and my question's just referring to my looping method, I'm content with it's contents). This is just a general loop that I've been using to make changes to fields in all found records.

It generally just contains Set Fields.

As a programmer, I was just interested to see if there's a more effective way to do this.

And thanks for the Get hint. I always look over how many things that function can handle.

Thanks!

Edit:

And yes, the two layouts are related, by Item Number. Layout2 simply has many occurences of Item Number differentiated by multiple Lot Numbers.

Link to comment
Share on other sites

This topic is 6481 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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