Newbies bastrop_attitudes Posted October 31, 2008 Newbies Share Posted October 31, 2008 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 Link to comment Share on other sites More sharing options...
Kevin Frank Posted October 31, 2008 Share Posted October 31, 2008 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. Link to comment Share on other sites More sharing options...
comment Posted October 31, 2008 Share Posted October 31, 2008 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. Link to comment Share on other sites More sharing options...
Newbies bastrop_attitudes Posted October 31, 2008 Author Newbies Share Posted October 31, 2008 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. Link to comment Share on other sites More sharing options...
Newbies bastrop_attitudes Posted October 31, 2008 Author Newbies Share Posted October 31, 2008 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! Thanks for making it looks so easy! : Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 5791 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 accountSign in
Already have an account? Sign in here.
Sign In Now