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

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

Recommended Posts

Posted

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.

Posted

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.

Posted

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 )

)

  • 3 months later...

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 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.