This may sound rather boring, but whilst coding today I realised that “foreach” flow statement isn’t present in the Servoy JavaScript.
Please add this in for the next release, as now there is no simple way of walking through an associative array.
Cheers,
Lee.
AFAIK it’s absent even in JavaScript 1.5 (EcmaScript v3).
Don’t know about JScript 5.
Armando
OK, I’m a twat - please disregard. ![Embarassed :oops:]()
Obviously a tad bit rusty on the old javascript syntax, too many languages running riot in my head. For anyone as dense as I am today here is the javascript version of foreach that works in Servoy:
for(var key in associativeArray)
{
application.outupt(key);
}
Lee. ![Rolling Eyes :roll:]()
leemcneil:
sed that “foreach” flow statement isn’t present in the Servoy JavaScript.
AGhisalberti:
AFAIK it’s absent even in JavaScript 1.5 (EcmaScript v3).
now IT IS, along with some other new Array metohds.
Cool the new E4X (ECMA 357), JavaScript XML extension.
The new JavaScript 1.6 is already embedded in Rhino.
http://developer.mozilla.org/en/docs/Ne … Script_1.6