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
Cf or Let Calculation to check values from list without Position maybe without recursion
Started by cat traveller, Feb 16 2012 03:56 AM
let position recursion
2 replies to this topic
#1 OFFLINE member
Posted 16 February 2012 - 03:56 AM
#2 OFFLINE consultant
Posted 16 February 2012 - 04:32 AM
Why not do it all at once, without recursion?
will return a list of keys that appear in list.
FilterValues ( keys ; list )
will return a list of keys that appear in list.
#3 OFFLINE member
Posted 16 February 2012 - 05:44 AM
Thanks a ton- this really helped- I was really lost on this one!
Also tagged with let, position, recursion
Database Schema & Business Logic →
Calculation Engine (Define Fields) →
Filtering an array Mixed Virtual Portal Let ( ) enquiryStarted by cat traveller, 13 Feb 2012 |
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users































