Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a loop function that has an "end loop if Afield =valueListItem ("student" ; "school location")

but it seems not to work... it keeps on looping like the value is false.... any hints?

Posted

ValueListItems returns a list of values. If you want to check that a field is equal to one of the values then you need to check that it is in the lis. For example

PatternCount(Afield;ValueListItems("student";"school location")) > 0

should normally work, but, if there is a possibility of Afield being actually within one of the values then you may have to add in some extra carriage returns to ensure that you are checking for a complete value:

PatternCount("¶" & Afield & "¶";"¶" & ValueListItems("student";"school location") & "¶")> 0

There may be simpler ways of doing this, if so it would be nice to see them.

Posted

There could be some syntactical things wrong, I do always make the first parameter in the function a Get ( FileName ) instead of hardwirering.

Next thing that comes to mind is if the field the valuelist is basede on can't be indexed, will the valuelist be very very short :

But it surprises me that a school location only exists in a valuelist, is it a dynamic valuelist?? If so couldn't a multicriteria relation ship be used instead to establish a IsValid[

http://www.filemaker.com/help/FunctionsRef-311.html

...which is almost, if not quite the same as you "Help" throws up!

To me is VL's here a convoluted way of establishing a membership of a found set of records.

--sd

Posted

well, I know the valulist is coming from another file not table. And it is just a list not from a field... however, I am going to change that and make a new table in the same file that allows the user to add a school location as a new record. Then I will base the valuelist off that field from that table. Let me set that up first and see if it functions better that way.

Posted

Not quite nessersary, just move the valuelist defintion to the file where the script runs, and reference it instead of the valuelist in the other file.

--sd

Posted

now I just changed the name of the file to the Get(filename) instead.. nothing! still remains in the loop. I know the calculation has to be a bolean, so I am thinking Afield has to = something from the valuelist. Sounds easy...

Posted

You can't build valuelist with globals due to the lack of indexes, could you make a small template for us to investigate without japanese signs???

--sd

Posted

well, the value isn't coming from a field. The list is a custom value. The field that the endloop if function is a global. I will make just a simple layer using it and post it.

Posted

Hi Himitsu

Many apologies for failing to see this earlier but I console myself with the thought that I am not the only one who missed it. The PatternCount function has it's parameters the wrong way round. In your sample use:

Exit loop If[

PatternCount (ValueListItems (Get ( FileName ) ; "school location" );valueListValidate::location_G

)]

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