Originally Posted By: Shanee
Have you tried displaying the excel array before the sort? That would atleast help determine where the problem is. And don't forget that readexcel2 returns a multiple dimension array.

 Code:
$Brandshop = readexcel2(@Scriptdir + '\pccs.xlsx',,-1,-1)
For $i = 0 to UBound($brandshop)
   For $j = 0 to UBound($brandshop,2)
      ? $brandshop[$i,$j]+@CRLF
   Next
   ?
Next

(untested)


I know that the array is returned correctly because I am using it's logic further down my script in matching not only the brand (second column) but values for each office (first column).

The section I am trying to add in now is input validation to ensure that the brand chosen in the '--b:' input is something which exists in the second column of the spreadsheet.

Although I am using IsInArray() for the input validation to ensure that the value is valid, because number of brands is greater than numbers of offices, there will be duplicates of brands, and I want to output to the user the valid list which they could choose from. This is why I need a uniq() and qsort() done.

In either case I need to know how to address the array even if I was referencing the array which is the second column directly into IsInArray().

Pax

edit: ran your code anyway and it outputs the array to screen fine.


Edited by Pax (2010-10-08 11:50 AM)
Edit Reason: I've done stuff