Structured one dimension Array

Discussion in 'Questions (Windows Mobile)' started by Cableguy, Jun 27, 2007.

  1. Cableguy

    Cableguy Expert Licensed User


    I'm reading data from a file(ini) wich as the follwing data:


    I defined an array like this:

    Dim Type(Fruit,Quantity) Basket(3)

    Now I whant to populate the array with the data read from the file
    Since this is a finite and short list I am reading line-by-line, but how do I populate the array?

    I tryed this

    But it return an error message saying that basket is not a one dimension array...

  2. Erel

    Erel Administrator Staff Member Licensed User

    You can't do it directly. (It will be supported in the next version)
    For now you will need something like:

    Sub Globals
    Dim Type(Fruit,Quantity) Basket(3)
    Dim Type(Fruit,Quantity) Temp
    End Sub

    For i = 0 to 2
    r = FileRead(c1)
    Temp() = StrSplit(r,"-")
    Basket(i).Fruit = Temp.Fruit
    Basket(i).Quantity = Temp.Quantity
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice