Customer Portal

Problem using parameters in functions

Comments 3

  • Avatar
    avackova
    0
    Comment actions Permalink
    Hello,
    parameters are just replaced by theirs values, so when you use parameter as string you have to quote it:
    integer min = ${MIN};
    string dir = "${DIR}";

    is evaluated as:

    integer min = 10;
    string dir = "C\:/workspace";

    while
    integer min = ${MIN};
    string dir = ${DIR};

    is evaluated as:

    integer min = 10;
    string dir = C\:/workspace;

    what (properly) leads to parse error.

    eval function proved to be useless, so it has been removed from ctl2.
  • Avatar
    codemonkee
    0
    Comment actions Permalink
    Thanks.

    Just curious, in this example would you need to resort to something like "${" + "DIR}" to output a string of "${DIR}" so it wouldn't be replaced by the parameter value?
  • Avatar
    avackova
    0
    Comment actions Permalink
    Yes, the only way to get string like ${param} for existing param is to split it into two strings :)

Please sign in to leave a comment.