Welcome to SPN

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

Sign Up Now!
  1. Guest ji, please consider donating today!   Become a Supporter    ::   Make a Contribution   
    Monthly (Recurring) Target: $300 :: Achieved: $95

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 ?
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page