This looks like it should work but for some reason the indexed value is not being removed. I think it must be something really simple but??? Here is the code:
var debug:Boolean = true;
var rtn:Array = database.getView("vwWFSApplicationsEnabled").getColumnValues(0);
var i:Integer = rtn.indexOf("Admin");
if (debug) print ("Position of Admin = " + i + " rtn = " + rtn.toString() )
if (i >= 0){
if (debug) print("In splice " )
rtn.splice(i , 1);
if (debug) print("after Splice " + rtn.toString() )
}
return rtn.unshift("--- Select Application ---");
When it runs I get this in the log:
HTTP JVM: Position of Admin = 1 rtn = [Absence Requests, Admin, Demo]
HTTP JVM: In splice
HTTP JVM: after Splice [Absence Requests, Admin, Demo]
i is being set in the indexOf to 1 which is correct so the splice(i, 1) should remove the value Admin from the array but after the splice the value Admin is still in the list. I've used the split in other situations and it works there but I can't see any difference in this code.