How to declare array of structures of bytes

Discussion in 'Questions (Windows Mobile)' started by HARRY, Feb 13, 2008.

  1. HARRY

    HARRY Active Member Licensed User

    Hi,

    I tried several possibilities, but I do not succeed to declare the following:

    an array (10) of structures; each structure consisting of two fields of the type Byte.


    Please help,

    Harry
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Declare:
    Dim Type(x,y) SomeName(10) As Byte

    Use:
    SomeName(6).x = 65
     
  3. HARRY

    HARRY Active Member Licensed User

    Erel,

    My problem appeared not to be the declaration, but the addressing,

    Many thanks,

    Harry
     
  4. derez

    derez Expert Licensed User

    array - type

    Harry
    It is equivalent to two-dimensional array:
    the array somename can be reffered to as somename(i,j) where the i can go from 0 to 9 and the j from 0 to 1.

    Example:
    Dim Type(No,Surname,Name,Nick,Father,Mother,Spouse,Marriage,Sex,Fcod,Mcod,Scod,Gen,Pic,Birth,Death,Prev_N)DB(2500)
    Dim Type(No,Surname,Name,Nick,Father,Mother,Spouse,Marriage,Sex,Fcod,Mcod,Scod,Gen,Pic,Birth,Death,Prev_N)record
    .......

    For i = 1 To dbsize
    For j = 0 To 16
    db(i,j) = record(j)
    Next
    Next
     
Loading...