Question : Sahi scripting

Adding this line: var $Array2 = getLinks();
to my code the "undefined variable" problem is gone. Now I have a different problem, with java I believe. My code:
var $Array1 = new Array("3 Face Blend on Mixed Walls", "Assimilation Blend Support", "Detect Loss of Blend Overflow");
function getLinks(){
      var $retVal = new Array();
      var $links = document.links;  
      for (var $i=0; $i<$links.length; $i++){
            $retVal[$i] = $links[$i].innerHTML;  //getText or some other function?
      }                                            //links.getElementById("").innerHTML;
      return $retVal;
}
importPackage(java.util.Arrays)
var $Array2 = getLinks();
var $check = java.util.Arrays.equals($Array1, $Array2);
if($check == false)
      Packages.java.lang.System.out.println("Projects' names don't come in the right order.");
else
      Packages.java.lang.System.out.println("Projects' names come in the right order.");
This is the error message I get:
JSERROR
The choice of Java constructor equals matching JavaScript argument types (object,object) is ambiguous; candidate constructors are:
boolean equals(char[],char[])
boolean equals(java.lang.Object[],java.lang.Object[])
boolean equals(float[],float[])
boolean equals(double[],double[])
boolean equals(boolean[],boolean[])
boolean equals(byte[],byte[])
boolean equals(long[],long[])
boolean equals(int[],int[])
boolean equals(short[],short[]) at 24-Aug-2010 12:02:50
I don't know how to carry on from here. Anyone any light on this?

Ana
      

Answer : Sahi scripting

Why not just javascript?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var $Array1 = new Array("3 Face Blend on Mixed Walls", "Assimilation Blend Support", "Detect Loss of Blend Overflow");
function compareLinks(){
  var $links = document.links;  
  for (var $i=0; $i<$links.length; $i++){
    if ($Array1[$i]!==$links[$i].innerHTML) return false;
  }                                    
  return true;
}

if (compareLinks()) alert('They are the same');
Random Solutions  
 
programming4us programming4us