Displaying only one column of an array

Results 1 to 2 of 2

Thread: Displaying only one column of an array

  1. #1
    Join Date
    Dec 1969

    Default Displaying only one column of an array

    I have a fixed-length array with two columns (0 and 1). I am using the quicksort method from the "Sorting Two Dimensional Arrays: VBScript Implementation" article to sort column 1. This all works fine, however, I only want to display column 0 on the page. I tried to decypher and modify the PrintArray function from the article but with no luck.<BR><BR>Does anyone know how to modify PrintArray to display just one column, or maybe a another method for displaying an array?<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Displaying only one column of an array

    No idea what is in that article, but showing one column is easier than showing many.<BR><BR>Just<BR><BR>For i = 0 To UBound( theArray, 2 )<BR>&nbsp;&nbsp;&nbsp;&nbsp;Response.Write theArray( columnYouWant, i ) & "<BR>" & vbNewLine<BR>Next<BR><BR>I might point out that sorting a two-dimensional array is a *LOT* slower than sorting a one-dimensional array. If you don&#039t need the other column(s), converting it to one-dimensional *before* sorting would help your performance, possibly a lot!<BR><BR>Also, if you use JScript (JavaScript) instead of VBScript, the language includes a builtin "sort the array" functionality.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts