Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Struct Array (like c)

Discussion in 'Information Technology' started by pechoi@syr.edu, Jul 28, 2006.

Tags:
  1. pechoi@syr.edu

    pechoi@syr.edu
    Expand Collapse
    Guest

    Hi,
    I am new in access programming and I was wondering how to do C like
    struct in array
    I have something like:
    '// Start Code
    Option Compare Database
    Public Type myPlayer
    Dim gnHandId As Double
    Dim gnMoney As Double
    End Type

    Function test()
    Dim playerArray {2} as myPlayer

    end function
    '// End code

    And it is keep saying "{" after "Dim playerArray" is invalid char.
    Anyone show me what's wrong with it ?

    Thx
     
  2. Loading...

    Similar Threads Forum Date
    Structure Of The Guru Granth Sahib New to Sikhism May 30, 2016
    Heritage 16th-century Sikh Structures Identified For Preservation In Tarn Taran History of Sikhism Mar 10, 2015
    1984 Trial of four cops sought in 1984 genocide case for destruction of proof History of Sikhism Feb 1, 2014
    SciTech Meditation and Brain Structure Breaking News Jan 7, 2014
    World Toilet Trouble: New Technology and Infrastructures with Dr. Doulaye Kone Breaking News Oct 26, 2013

  3. xRoachx

    xRoachx
    Expand Collapse
    Guest

    Hi -- Use () to define the array size instead of {}: Dim playerArray (2) as
    myPlayer

    "pechoi@syr.edu" wrote:

    > Hi,
    > I am new in access programming and I was wondering how to do C like
    > struct in array
    > I have something like:
    > '// Start Code
    > Option Compare Database
    > Public Type myPlayer
    > Dim gnHandId As Double
    > Dim gnMoney As Double
    > End Type
    >
    > Function test()
    > Dim playerArray {2} as myPlayer
    >
    > end function
    > '// End code
    >
    > And it is keep saying "{" after "Dim playerArray" is invalid char.
    > Anyone show me what's wrong with it ?
    >
    > Thx
    >
    >
     
  4. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Lose the "Dim" inside the Type declaration, and use () around the array
    bounds.

    (BTW, Option Explicit is essential to your sanity.)

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    <pechoi@syr.edu> wrote in message
    news:1147348713.858094.10010@i39g2000cwa.googlegroups.com...
    > Hi,
    > I am new in access programming and I was wondering how to do C like
    > struct in array
    > I have something like:
    > '// Start Code
    > Option Compare Database
    > Public Type myPlayer
    > Dim gnHandId As Double
    > Dim gnMoney As Double
    > End Type
    >
    > Function test()
    > Dim playerArray {2} as myPlayer
    >
    > end function
    > '// End code
    >
    > And it is keep saying "{" after "Dim playerArray" is invalid char.
    > Anyone show me what's wrong with it ?
     

Share This Page