more help with arrays?

Results 1 to 3 of 3

Thread: more help with arrays?

  1. #1
    Join Date
    Dec 1969

    Default more help with arrays?

    if i want a 2-d array, is it array(column, row)?

  2. #2
    Rob Guest

    Default RE: more help with arrays?

    The first index is the Row, the second index is the Column. It functions like a table.<BR><BR>Regards,<BR>Rob

  3. #3
    Join Date
    Dec 1969

    Default Misleading answer!

    I hesitate to call Rob wrong, because his answer is the traditional one. But in ASP...<BR><BR>First of all, in most cases, it is *your choice* as to which dimension relates to which characteristic.<BR><BR>Maybe a 2D array is actually <BR> &nbsp; Dim ResponseTime( depth, distance )<BR><BR>However...<BR><BR>In the most important place in ASP where the *system* hands you a 2D array, the answer is the opposite of Rob&#039s.<BR><BR>&#060;%<BR>Set RS = someConnection.Execute( "SELECT * FROM table" )<BR>allRecords = RS.GetRows<BR><BR>anyField = allRecords( columnNumber, rowNumber )<BR>%&#062;<BR><BR>Yep, GetRows, that most useful and speedy of ways to get data from a RecordSet into an easily accessible form, returns a 2D array which is the opposite of what you might expect: columns first, rows second.<BR><BR>If you care why, it has to do with how ReDim Preserve works in VBScript.<BR><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