Re: Playing with multidimensional array!?



In traditional compiler languages, rows and columns are differentiated by
the fact that a two dimensional array occupies contiguous storage locations.
A 2x2 array would then consist of these four elements: a(0,0), a(0,1),
a(1,0), a(1,1) in that order. Or maybe this order: a(0,0), a(1,0), a(0,1),
a(1,1). Not only do I forget this detail, I always had trouble remembering
it in the first place, as it always seemed counterintuitive.

Regardless, one could code in such a way that the order was considere
row,column, or column,row - as long as one consistently followed the same
convention.

Scripting languages like vbscript store their arrays in quite a different
fashion, so the distinction is probably even less important, except for the
fact that redim can affect only the last dimension. Some people even
consider these the first dimension and the second dimension rather than row
and column (or vice versa). And that rather bland approach tends to make it
simpler when going to higher order arrays having a third or fourth
dimension. Now, was that row, column, plane, time or column,plane,time,
row???

see:
http://www.emu.edu.tr/english/facilitiesservices/computercenter/bookslib/Laura%20Lemay's%20Web%20Workshop%20ActiveX%20And%20VBScript/f10-5.gif
..

/Al

"Claude Lachapelle" <ClaudeLachapelle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:5EFB99AB-35C3-4D89-9DCC-B4B30483FDFE@xxxxxxxxxxxxxxxx
I agree -- like I saw suggested, arrays in arrays, that could be row,
column
(the second dimension is another array).

I never programmed an array to be accessible beginning by the column -- C,
C+, Pascal, Turbo Pascal, dBase, Clipper (I'm an old timers programmers,
sorry).

Thanks.

"McKirahan" wrote:

"Claude Lachapelle" <ClaudeLachapelle@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:1BD75497-1FD8-41A2-A7C1-B1C53FB895B0@xxxxxxxxxxxxxxxx
Thanks a lot for your help.

Correct me if I'm wrong (I really found that unusual!), but when
accessing
data into the two dimensions array, the first parameters is always the
column, and the second one the row...

I wouldn't say "always".

To read the data in my array you might use:

Dim iCol, iRow
For iRow = 0 To UBound(aMailboxes,2)
For iCol = 0 To UBound(aMailboxes,1)
WScript.Echo iRow & "." & iCOL & " = " & aMailboxes(iCol,iRow)
Next
Next

I'm always confused with that since others old programming languages
are
functionning by beginning by the row...

I've worked in COBOL, Fortran, et.al. and it was I
(the progrmammer) that determined what index meant what.

[snip]





.



Relevant Pages

  • Extracting nth element of X dimension
    ... I have a 5D array. ... I have counters which I use for the first, third, ... the length of the second dimension is changing constantly as ...
    (microsoft.public.excel.programming)
  • Dynamic 2D array?
    ... Is it possible to declare a 2D array, which has different lengths in the 2nd ... MyArray dimension1 should have 5 values in the second dimension ...
    (comp.lang.pascal.delphi.misc)
  • Re: Error on UBound with Dynamic Array
    ... ReDim Preserve arrSplit+ 1) ... is that arrSplit has not yet been dimmed as having any dimension. ... need to use a dynamic array and may be checking the boundries, ... Public Function Split(csvString As String) As Variant ...
    (microsoft.public.access.modulesdaovba)
  • Re: Program Fails When Parameter Fixed Constants are Changed (F77) ??
    ... subroutine and then call DCpZeros passing VxGrid, nRdim, and nTHdim. ... Then DCpZeros can dimension VxGrid (nRdim, ... (PS. I'm not concerned or worried about the array bounds exceeded! ...
    (comp.lang.fortran)
  • Re: Array of pointer Vs Pointer to Array
    ... that points to an array. ... Now 'pa' is a pointer form of accessing the values in 'matrix'. ... that depends on a variety of things - the size of the other dimension, ... the regular indexing style is a good first guess, ...
    (comp.lang.c)