I have the data like the following: ----------------------- index information 1 A,B,C 2 A,B,C 3 A,B,C -----------------------
Is that possible to get the data in specific token using the separator ','? The expected result is: ----------------------- index information 1 A 2 B 3 C -----------------------
I tried with SCRIPT function but get the error 'sun.org.mozilla.javascript.internal.InterpretedFunction@554eef31'
------------------------------ SCRIPT(" function getToken(sVal, iIndex, sDelimiter) {
if (sDelimiter.length > 0) { var aSubString = new Array(); aSubString = sVal.split(sDelimiter);
You have only defined a function, and not called it. The result of your Javascript is the function itself. For example: function a(x, y) { return x*y; }
Here the result has type Function and is the function object itself. Within browser-based JS, you might pass this to event handlers, for example, but as a return value for the SCRIPT function, it's of no use.
Instead you need to ensure the *last* expression in the JS is the desired result. For example: function a(x, y) { return x*y; } /* here, any other code, irrelevant to result */ a(2,3); // result expression