Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Variable belonging to a set with IN command

edited September 2015 in RAP
Hello all,
I would like to perform a control on a variable value before some calculation.
The variable could have many acceptable values (e.g. 1, 2 and 3) that for me are all the same in this control, such as:

IF variable IN (1, 2, 3) then
Execute a calculation
ELSE
Execute another calculation

Looks like the IN command is not accepted in RAP, and I would like to avoid a list of IF...OR conditions: is there any accepted syntax?

Thank you very much,
Fabio


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

Comments

  • edited September 2015
    Hi Fabio,

    RAP does not support the 'in' command however it does fully support case
    statements.

    case of
    1, 2, 3: //Execute Calculation
    else
    //Execute Calculation
    end;

    Another option would be to create a passthru function that performs the
    special IN condition and returns a result. See the RAP demos for
    examples of how to create passthru function for RAP.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.