Expand my Community achievements bar.

Array String vars

Avatar

Former Community Member
Hi



Who use Array String vars with FormCalc my problem is resalve with javascript bus in this moment I need in formcalc



Other question is



Who use the len Funtion in javascript, or what is it equivalent?



I have a method in my company I need that method in my form but that use Len Funcions, arrays and Substr Funtion



Who resolve that, is posible?



Thanks?
1 Reply

Avatar

Former Community Member
In JavaScript, the Len function probably translates to the
length property on objects such as arrays and strings:



"This is a string".length; // returns 16



var a = new Array(10);

a.length; // returns 10


But it sounds like you're looking for ways to calculate the length of a string, extract a sub string and create an array of strings all in FormCalc as opposed to JavaScript.



For the string length, you would use the Len(str) function:



Len("string"); // returns 6


For a sub string, you would use the Substr(s1, n1, n2) function:



Substr("string", 2, 4); // returns "ring"


Finally, I don't think arrays are supported in FormCalc since the language is built for simple calculations and performance as opposed to JavaScript.



Is there a specific reason why you can't use JavaScript in this particular case? Is there something you need to do in JavaScript but only know how to do in FormCalc?



Stefan

Adobe Systems