DIM TYPE - redimming is it possible

Discussion in 'Questions (Windows Mobile)' started by mattsaintdev, Dec 15, 2008.

  1. mattsaintdev

    mattsaintdev Member Licensed User


    i have a 2d array in the Globals section e.g.

    Dim Type(dbref,firstname,surname) Personnel(0)

    In a function i would like to 'REDIM' the size of the array but when i do ;

    Sub MyFunc
    Dim Personnel(100)
    End Sub

    The array looses its TYPE and becomes an array of 100 elements - or so the compiler says.

    Thanks in advance!

  2. klaus

    klaus Expert Licensed User

    Instead of

    Sub MyFunc
    Dim Personnel(100)
    End Sub
    you should use

    Sub MyFunc
    Dim Personnel(100,3)
    End Sub
    B4PPC treats the Type Variable as 2 dimensional arrays.

    In your case with
    Dim Type(dbref,firstname,surname) Personnel(0)
    Dim Personnel(100,3)

    Personnel(10).dbref is the same as Personnel(10,0)
    Personnel(10).firstname is the same as Personnel(10,1)
    Personnel(10).surname is the same as Personnel(10,2)

    Best regards.
  3. mattsaintdev

    mattsaintdev Member Licensed User

    Thanks for the quick reply.
  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