Hi,
I was looking at the new properties (2.2.1 final) in the Servoy Editor that give us an Array with all Methods or Relation Names.
Very handy, but I’m missing one Array function that woul dbe usefull: indexOf, which would return the position inside an Array that hold a certain value, for example:
var i = globals.allmethods.indexOf('test');
if (i == -1) application.output('Method Test doen not exist.')
I found this indexOf function here:http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array in the Accessor methods area. Seems very handy to have. Otherwise, you’d have to build loops everytime you need to test if the Array holds a certain value.
Paul
PS: I was under the impression JavaScript 1.5 was implemented fully in Servoy, but this indexOf function (which seems to be part of JavaScript 1.5) is not implemented, it seems (or I did something stupid to not get it to work…)