When I try to use the code below I receive an error on line 16 : “Operator ‘>’ cannot be used with a left hand side of type ‘Object’ and a right hand side of type ‘Object’.” Where is the error since i was unable to find it.
#pragma strict
var taskPri : Array = Array();
var taskNam : Array = Array();
var highPri : int;
function NewTask(name : String, priority : int) {
taskPri.Push(priority);
taskNam.Push(name);
}
function takeTask() {
highPri = 0;
for(var x : int = 0; x < taskPri.length; x++) {
if(taskPri[x] > taskPri[highPri]) {
highPri = x;
}
}
}
PS : The code itself is not finished.