Matt Klein Posted March 30, 2005 Posted March 30, 2005 Basically, what I am looking for is a custom function that can take a value list and create every permutation of the items in the value list. Say I have a value list "cat;dog;mouse", I want to be able to feed the custom function that value list and get: cat dog mouse cat mouse dog dog cat mouse dog mouse cat mouse cat dog mouse dog cat The order of the permutations doesn't matter as long as all the permutations are returned. Also, the number of values in the list I feed it is variable. One time it may be three values as above, another time it may be four and so on. Anybody help? I have been staring at my screen for hours. I am hoping this is easy for someone.
Zero Tolerence Posted March 30, 2005 Posted March 30, 2005 Let ([ a = ValueListItems ( flName; List Name ); /* get the items in your list */ b = PatternCount ( b ; "
Matt Klein Posted March 30, 2005 Author Posted March 30, 2005 Thanks for the thoughts. I was hoping someone would have a recursive function that would eliminate the need for all that code. I am actually currently hard coding it, but it's not very flexible.
Ender Posted March 30, 2005 Posted March 30, 2005 Try adapting this custom function from Jed Verity: http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=230 There's also a sub function that's required: http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=231
Zero Tolerence Posted March 31, 2005 Posted March 31, 2005 I don't understand what a recursive function is or what it does or means? Anyone?
RalphL Posted March 31, 2005 Posted March 31, 2005 A recursive function is a function that calls itself until a condition has been meet. Excelisys has a good pdf on this subject on their web site. http://www.excelisys.com
comment Posted March 31, 2005 Posted March 31, 2005 A recursive function recurs, i.e. loops until a condition is met. Somewhat similar to a looping script with Exit Loop If[]. In Developer7 you can write custom functions, and a custom function can call itself, thus being recursive. Example: Custom Function: CountFromTo ( start ; end ) Returns a comma-separated list of integers starting from start and ending with end. Case ( start <= end ; start & ", " & CountFromTo ( start + 1 ; end ) )
Matt Klein Posted March 31, 2005 Author Posted March 31, 2005 Try adapting this custom function from Jed Verity: http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=230 There's also a sub function that's required: http://www.briandunning.com/filemaker-custom-functions/detail.php?fn_id=231 That did the trick!!! Thanks.
Raybaudi Posted July 7, 2005 Posted July 7, 2005 Hi, attached my little contribution to your problem... two custom functions: one for five characters and one for five fields. permutazioni.zip
Recommended Posts
This topic is 7080 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