[AccessD] Syntax Problem with Array
Gustav Brock
gustav at cactus.dk
Sat Nov 27 15:21:03 CST 2021
Hi Arthur
Nothing wrong, only is this not VBA syntax.
You can do something like:
<code>
Const LDoms As String = "31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31"
Dim LDom As Integer
’ Pick the 5th element.
LDom = CInt(Split(LDoms, ",")(4))
Debug.Print LDom
</code>
Fra: Arthur Fuller<mailto:fuller.artful at gmail.com>
Sendt: 27. november 2021 21:34
Til: Access Developers discussion and problem solving<mailto:accessd at databaseadvisors.com>
Emne: [AccessD] Syntax Problem with Array
1. I'm trying to declare a Constant array. This is not working:
Const LDoms() as Integer = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
I get the same bad result if I use parentheses instead of curly braces.
What am I doing wrong?
--
Arthur
More information about the AccessD
mailing list