Am 21.08.2018 um 21:32 schrieb David Fertig:
I have a variable called numFiles, which I can print and verify contains
an integer.
Integer numFiles = vars.getObject("numFiles");
I want to make a random number between 0 and that value. But all of the
following fail
${__Random(0,__ ${numFiles},docIndex)};
Integer docIndex = ${__Random(0,${numFiles})};
${__Random(0,__ numFiles,docIndex)};
Integer docIndex = ${__Random(0,numFiles)};
All with an errors like:
Uncaught Exception java.lang.NumberFormatException: For input string:
"${NUMFILES}". See log file for details.
Uncaught Exception java.lang.NumberFormatException: For input string:
"numFiles". See log file for details.
How do I pass a variable into the random() function?
It seems that this is a bug. At the moment the Strings given to __Random
will not be evaluated (and therefore the Integer will not be transformed
into a String).
Till the bug is fixed, you will have to transform the Integer into a
String by yourself.
Regards,
Felix
Thank you
David
This email, including attachments, may contain information that is
privileged, confidential or is exempt from disclosure under applicable law
(including, but not limited to, protected health information). It is not
intended for transmission to, or receipt by, any unauthorized persons. If
the reader of this message is not the intended recipient, or the employee
or agent responsible for delivering the message to the intended recipient,
you are hereby notified that any dissemination, distribution or copying of
this communication is strictly prohibited. If you believe this email was
sent to you in error, do not read it. Please notify the sender immediately
informing them of the error and delete all copies and attachments of the
message from your system. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]