Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Does anybody have an example of a Script using a field of values and looping through it? I had found the FileMaker article here http://help.filemaker.com/app/answers/detail/a_id/2403 and added the good advice, that this is not currently the best way to do this, and other advice to not use copy and paste (a better way is to set variables and retrieve them was the advice of many knowledgeable people). In this article it show a way to use a loop to run through the records in a portal, and send the useful data to another field. It works but does not seem to be that efficient. One thing that makes me wonder about it, is this is the only script that show and hour glass in my solution.  So what if you had the list of values in field and wanted to check if some condition was true or anything else on the values. If these values are in a field how can you loop through and perform condition checks and such. I have already determined that you have to use ValueCount() instead of Count to count them, I was sitting 15 minutes wondering why Count was always 1. Pic shows type of result I am referring to.

 

http://pctechtv.com/show/listscript.png

 

Posted
 So what if you had the list of values in field and wanted to check if some condition was true or anything else on the values.

 

Not sure what exactly would you want to do as a result of the check. In general, the loop could go something like this:

Loop
 Set Variable [$i ; $i + 1]
 Exit Loop If [$i > ValueCount ( YourTable::YourField )]
 If [GetValue ( YourTable::YourField ; $i ) > 100]
  # do something here
 End If
End Loop
Posted

It's not possible to assess a solution without understanding the problem it is designed to solve. Of that you have told us nothing and neither does your script. It looks like you are creating child records based on a list held in a field (or fields?) of the parent, but I cannot figure out what your tables are and what are the relationships between them.

 

One thing that stands out is that your loops have a Go to Layout[] step but you never leave that layout, so that seems like a redundant repetition.

 

 

---

BTW, "INFORMATION" is a really cryptic name for a table; all tables hold information. At least I haven't yet seen a table that contained socks or kitchen utensils...

  • Like 2

This topic is 4032 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.