Results 1 to 2 of 2

Thread: [2005] Array list of array lists?

  1. #1

    Thread Starter
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    [2005] Array list of array lists?

    The title should sum it up fairly well... if it were VB6, I'd create a 2D array of strings, since that's what I need... kinda. I keep jumping ahead of myself...

    I'm reading information in from an XML file. If anyone's seen the threads I posted about it last week, yes it's the same project... probably the same problem, but I think I have an edge now. This XML file is comprised of three second-level tables. By second level, I mean I have the root tag, a table name, then elements of that table, each element having it's own properties. Brief example:

    Code:
    <root>
      <ShippingCosts>
          <ship type="PD" cost="2.99" value="10.00" ></ship>
          <ship type="FEGR" cost="8.99" value="10.00" ></ship>
      </ShippingCosts>
    </root>
    I have six other XML files that I'm playing with, but they are all first-level tables.. meaning there is no <ShippingCosts> equivilant table, just information.

    So, what I need to do is look at every table in the file and scan it for the fields it contains. I have a loop that does that right now and relays it in outline format, but I need to keep that information stored for when I turn around and start adding items. One method would be to use one arrayList and have the first part be the table name with each element appended to it with a delimiter... but I'd like to avoid that if possible. And a VB6-style 2D array would be overkill because the tables don't all have the same number of entries. Any pointers how to do this?

  2. #2
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Re: [2005] Array list of array lists?

    There was a recent thread on the subject of multidimensional arrays, from what you describe you have a jagged array. See http://www.vbforums.com/showthread.php?t=451710

Posting Permissions

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



Click Here to Expand Forum to Full Width