[AccessD] Array questions

Stuart McLachlan stuart at lexacorp.com.pg
Mon Jan 16 18:46:47 CST 2023


Obviously if you REALLY want to you can also have two rows and lots of columns, but that 
would be unusual

DIM a3(1 to 2, 1 to 10)
For i = LBound(a1()) To UBound(a1())
         a3(1, i) = a1(i)
         a3(2, i) = a2(i)
Next


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

> 5. Given 2 arrays of equal length, can I
> > create a 2D array with 2 rows and assign an array to each? 
> 
> You can create an array with two COLUMNS
> 
> > Given two arrays a1 and a2, both populated;
> 
> For i = LBound(myArray()) to UBOUND(myArray)
>     a3(i,1) = a1(i)
>     a3(i,2) = a2(i)
> Next
> 
> > 
> > Dim a3( a1, a2)
> > 
> > Why not?
> 
> Because that is nonsense? That's not what DIM does.
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list