I guess my problem can be solved pretty easily.
I want to write a function, that either returns a list of row-numbers or NULL in dependency of an if-clause inside my function.
How can I handle multiple return values and how can I return NULL?
My function should look somehow like this:
myFunction = Function( {...}, {...},
list = { ... };
if(...)
then return list
else return NULL
);
I have already found this tutorial:
https://community.jmp.com/message/25472#25472
but what if I have multiple return values, like:
return1=...
return2=...
how do I handle these, and how do I return NULL then?
Thank You for your help!
Might be safer to return a 0-element list if your if clause doesn't find any row numbers.
myFunction = Function( {...}, {...},
my_list = {};
if (my_test,
my_list = {1, 2, 3}; // Test passed, return values
);
my_list;
);
one_list = myFunction(...);
if (nitems(one_list) > 0,
// handle items in the list
);
Might be safer to return a 0-element list if your if clause doesn't find any row numbers.
myFunction = Function( {...}, {...},
my_list = {};
if (my_test,
my_list = {1, 2, 3}; // Test passed, return values
);
my_list;
);
one_list = myFunction(...);
if (nitems(one_list) > 0,
// handle items in the list
);
Thank You!
This solved my problem.