[AccessD] Array questions

Stuart McLachlan stuart at lexacorp.com.pg
Mon Jan 16 22:39:22 CST 2023


On 17 Jan 2023 at 10:09, Stuart McLachlan wrote:

> Nor can you assign a collection of values to multiple array elements.
> in one statement.
> 

I forgot the SPLIT function :)
You can as long as the array has not been dimensioned!

'Next line is not needed if you don't use Option Explicit - but that is NOT advised
Dim a() As String ' DO NOT DIMENSION if you are going to use SPLIT

Dim s As String
s = "One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten"
a() = Split(s, ",")
Debug.Print a(4) ' returns Five - resultant array is zero based!


More information about the AccessD mailing list