Struct Array (like c)

P

pechoi

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
 
X

xRoachx

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

Allen Browne

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top