February 16, 201213 yr Hello all, still I did not fully understand how to implement recursion.... admittedly I am lost- and very much so: There is a list of values = list By script, I am looping through another list with keys. Now I would like to check if the key is in the list. First I was thinking to get the value with Position ( list ; key; 1; 1). The problem is that in list, there might be 4651 and key might be 6, which would make Position true. However 4651 is not 6. Hence, I thought to loop through list by recursion and to check with the "=" but I dont know how to build this: Let ( [ list = thelist; k = thekey counter = 1 c = valuecount (thelist) ]; Case ( counter > c ; ""; // this is my exit GetValue ( list; 1) = k ; 1; and here is am not getting the calc to recurse... My second thought was to turn 6 into 0006 and then use Position. However the Length of the keys might change and it seems not the right approach. Who could help a dummy, please.... thanks
February 16, 201213 yr Why not do it all at once, without recursion? FilterValues ( keys ; list ) will return a list of keys that appear in list.
Create an account or sign in to comment