How to use brackets in #EVAL

Posted by Rollbase User on 15-Jan-2011 15:30

How can we use brackets in an #EVAL statement? I wasn't able to find the answer in the documentation. Simple example: #EVAL [ var x = new Array(11,12,13); return x[1]; // the closing bracket generate an error. ]

All Replies

Posted by Admin on 16-Jan-2011 00:26

EVAL was designed for rather simple formulas. We do not anticipate usage of [] inside EVAL. Perhaps you can use embedded hosted JS files of API,

Posted by Admin on 27-Jan-2011 18:23

I used the slice function to simulate the array brackets.
Still, it would be nice to add an escape caracter as an additional feature ( like \] ).


#EVAL [
var x = new Array(11,12,13);
return x.slice(1,2); // returns 12
]

This thread is closed