cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
martinschmid
Level II

Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script?

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!

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script?

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

);

View solution in original post

2 REPLIES 2
pmroz
Super User

Re: Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script?

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

);

martinschmid
Level II

Re: Returning either list of rows or NULL in my function. How do I work with multiple return values in a jsl-script?

Thank You!

This solved my problem.

Recommended Articles