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 5920 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I'm trying to figure out how to tell if a word/phrase/text string is the 1st word/phrase/text string, 2nd or 3rd in a list. I need a number (1-3) returned. It's after midnight and my brain is spinning circles...everything i've tried returns me either text or the the character position. Help, is there a way?

Ginger

Posted

Check out the "PositionValue" CF by Geoff Wells.

http://www.briandunning.com/cf/62

If you have a list...

Apple

Banana

Pumpkin

...and you ask for the "PositionValue" of Banana, it will return 2.

Posted

Your question is not quite clear. Assuming that by "list" you mean text items separated by carriage returns ("values" in Filemakerese), you can get the ordinal number of a given value in the list by:

ValueCount ( Left ( listOfValues ; Position ( ¶ & listOfValues & ¶ ; ¶ & searchValue & ¶ ; 1 ; 1 ) )

Note that this returns the "value position" of the FIRST occurrence of searchValue in listOfValues.

  • Newbies
Posted

Thank you for such a quick response! You guys, make it looks so easy! It makes sense now, don't know why I couldn't pull that out last night...!

That is exactly what I needed AND it introduces me to a new function. I'm coming from FM5.5 and trying figure out some of the new (and old) functions. I haven't any experience with the "Let" fuction, but I like it! especially for testing out how other functions works...it keeps the other code cleaner ...it can get confusing quickly with nested functions. Thank you, again.

  • Newbies
Posted

I knew there was something about the carriage returns (I didn't have/wasn't adding a carriage return to the beginning and the end of the list)! I just couldn't grasp what I needed to do. I had looked at all the functions you used, but not in that combination and I *just* couldn't get it last night! :bang:

Thanks for making it looks so easy! :

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