Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8028927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:16:46+00:00 2026-06-05T00:16:46+00:00

I think my code successfully creates the multi dimensional array because I get the

  • 0

I think my code successfully creates the multi dimensional array because I get the right amount when I count it with UBound(DataArray).

But I get null value when I try to display one of the data as Response.Write DataArray(1,0).

Any help appreciated!

 sDateArray = Split(DateArray, ",")
    sVenueArray = Split(VenueArray, ",")

    Dim DataArray()    
    For i = 0 to uBound(sDateArray)-1 
        ReDim DataArray(i, 1)
        DataArray(i, 0) = sDateArray(i)
        DataArray(i, 1) = sVenueArray(i)
    Next

    Response.Write UBound(DataArray) & "<br /><br />"
    DataArray(1,0)
    Response.Write DataArray(1,0)  
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:16:47+00:00Added an answer on June 5, 2026 at 12:16 am

    Try Redim Preserve DataArray(i, 1) instead of ReDim DataArray(i, 1)

    …or…

    sDateArray = Split(DateArray, ",")
    sVenueArray = Split(VenueArray, ",")
    
    Dim DataArray(uBound(sDateArray)-1, 1)    
    For i = 0 to uBound(sDateArray)-1
        DataArray(i, 0) = sDateArray(i)
        DataArray(i, 1) = sVenueArray(i)
    Next
    
    Response.Write UBound(DataArray) & "<br /><br />"
    ' DataArray(1,0) ' <== commented out cos I think this might be an error - ?
    Response.Write DataArray(1,0) 
    

    Ok I was bored so I wrote this.

    May not be perfect – it’s been a while since I used Classic ASP

    Function SortByDate(a_input)
    
        x = UBound(a_input, 1) - 1
        if( x < 1 ) Then
            Response.Write "<p>Invalid input array - first element is empty</p>"
            Stop
        End If
        Dim a_output(x, 1)
        Dim earliest_date
    
        For j=0 To x
            earliest_date = -1
            For i=0 To UBound(a_input, 1) - 1
                If a_input(0, i) <> "" Then
                    If earliest_date = -1 Then
                        earliest_date = i
                    Else
                        If CDate(a_input(0,i)) > CDate(a_input(0,earliest_date)) Then
                            earliest_date = i
                        End If
                     End If
                End If
            Next
            a_output(0, i) = a_input(0, earliest_date)
            a_output(1, i) = a_input(1, earliest_date)
            a_input(0, earliest_date) = "" ' this one is done so skip next time '
        Next
    
        SortByDate = a_output
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't think my code's the problem because it's working on my local server
Why always get the wrong formatting although I've set it? I think the code
The following C++ code i think is correct, but produce some warnings when compiled
This code breaks I think because there is time in SubmittedDt and DateTimeToday. How
Ok. here's the operations i successfully code so far thank's to your help: Adittion:
I think my code might be written incorrectly and this is causing my problem.
I think the following code can be used to create manipulators. #include<iostream> ostream &
Best explained with code I think, this is just a simple example: public class
The code below shows me (I think) that the for each loop is about
I think that looking at others' code is a good way to learn. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.