For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > January 2006 > Array Nomenclature









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Array Nomenclature
Darrell

2006-01-27, 6:56 pm

Can somebody tell me what the proper nomenclature for array "rows" and
"fields" is? It seems the accepted term for "rows" is "elements". But, I
don't find consistent terminology for the "fields". Please confirm the usage
of "elements" and enlighten me on "fields" (assuming standard nomenclature
exists).

Sorry for a picky question. It just would make communicating with my fellow
developer much easier.

Thanks!
--
Darrell
Saga

2006-01-27, 6:56 pm


Last time I checked it was
Rows
Columns -> fields


Can't garantee that this hasn't changed though <g>

Regards
Saga

"Darrell" <Darrell@llu.com> wrote in message
news:C57035AA-7EC8-4D91-B74F-A4E6AA1E371C@microsoft.com...
> Can somebody tell me what the proper nomenclature for array "rows" and
> "fields" is? It seems the accepted term for "rows" is "elements". But,
> I
> don't find consistent terminology for the "fields". Please confirm
> the usage
> of "elements" and enlighten me on "fields" (assuming standard
> nomenclature
> exists).
>
> Sorry for a picky question. It just would make communicating with my
> fellow
> developer much easier.
>
> Thanks!
> --
> Darrell



Darrell

2006-01-27, 6:56 pm

Hm... That's pretty straightforward. It's not specialized to arrays and could
be with table rows and columns. But, as I said, a standard,
specialized nomenclature may not exist. I'll see what others might have to
say, and if a consensus emerges.

Thanks!!
--
Darrell


"Saga" wrote:

>
> Last time I checked it was
> Rows
> Columns -> fields
>
>
> Can't garantee that this hasn't changed though <g>
>
> Regards
> Saga
>
> "Darrell" <Darrell@llu.com> wrote in message
> news:C57035AA-7EC8-4D91-B74F-A4E6AA1E371C@microsoft.com...
>
>
>

Jeff Johnson [MVP: VB]

2006-01-27, 6:56 pm


"Darrell" <Darrell@llu.com> wrote in message
news:C57035AA-7EC8-4D91-B74F-A4E6AA1E371C@microsoft.com...

> Can somebody tell me what the proper nomenclature for array "rows" and
> "fields" is? It seems the accepted term for "rows" is "elements". But, I
> don't find consistent terminology for the "fields". Please confirm the
> usage
> of "elements" and enlighten me on "fields" (assuming standard nomenclature
> exists).
>
> Sorry for a picky question. It just would make communicating with my
> fellow
> developer much easier.


(Since you didn't specifically mention it, I have to assume that you're
talking about a two-dimensional array.) In my experience, there is no
particular terminology. Arrays have elements, that's all. Dimensions are
merely a language construct to allow developers to write code in a manner
more logical to them. Ultimately most arrays will be sequential in memory,
with the indices in the various dimensions serving only to calculate the
memory offset where the element resides.

And now that I've said all that, I wonder if perhaps the answer is: "They're
all called 'dimensions.' No given dimension has a specific name."


RB Smissaert

2006-01-27, 6:56 pm

I am not an expert on these matters, but I work with arrays a lot.
I see it this way:
One dimensional arrays have elements only.
Two dimensional arrays have elements, rows and columns.
Not sure about three-dimensional arrays, never use these, but they will have
elements.
Fields is not something I would use with arrays as I think it just confuses
matters.

RBS


"Darrell" <Darrell@llu.com> wrote in message
news:C57035AA-7EC8-4D91-B74F-A4E6AA1E371C@microsoft.com...
> Can somebody tell me what the proper nomenclature for array "rows" and
> "fields" is? It seems the accepted term for "rows" is "elements". But, I
> don't find consistent terminology for the "fields". Please confirm the
> usage
> of "elements" and enlighten me on "fields" (assuming standard nomenclature
> exists).
>
> Sorry for a picky question. It just would make communicating with my
> fellow
> developer much easier.
>
> Thanks!
> --
> Darrell


Gman

2006-01-27, 6:56 pm

Just to add, highlighting something I've found confusing:

If you populate a variant directly from a recordset, creating a two
dimensional array

myVar = myRecSet.GetRows
myVar(0,0) is first row, first field of RecSet
myVar(0,1) is second row, first field of RecSet

Whereas should you use VBA and populate a variant from an Excel
worksheet you will find the opposite coordinates.

myVar = myWorksheet.cells
myVar(0,0) is first row, first field (column)
myVar(1,0) is second row, first field of RecSet

It always seemed a little odd to me that it's inconsistent. (The former
is more useful since you can always redim to add a new row - not
possible in the second.)

And to reiterate what others have written - it depends on how many
dimensions you have. Rows and fields are specific to 2D arrays IMO.

Darrell wrote:
> Can somebody tell me what the proper nomenclature for array "rows" and
> "fields" is? It seems the accepted term for "rows" is "elements". But, I
> don't find consistent terminology for the "fields". Please confirm the usage
> of "elements" and enlighten me on "fields" (assuming standard nomenclature
> exists).
>
> Sorry for a picky question. It just would make communicating with my fellow
> developer much easier.
>
> Thanks!

RB Smissaert

2006-01-27, 6:56 pm

To keep things simple I usually transpose the array with one of Alan Beban's
array functions.

RBS

"Gman" <nah> wrote in message news:uvHeIS5IGHA.3060@TK2MSFTNGP10.phx.gbl...[color=darkred]
> Just to add, highlighting something I've found confusing:
>
> If you populate a variant directly from a recordset, creating a two
> dimensional array
>
> myVar = myRecSet.GetRows
> myVar(0,0) is first row, first field of RecSet
> myVar(0,1) is second row, first field of RecSet
>
> Whereas should you use VBA and populate a variant from an Excel worksheet
> you will find the opposite coordinates.
>
> myVar = myWorksheet.cells
> myVar(0,0) is first row, first field (column)
> myVar(1,0) is second row, first field of RecSet
>
> It always seemed a little odd to me that it's inconsistent. (The former is
> more useful since you can always redim to add a new row - not possible in
> the second.)
>
> And to reiterate what others have written - it depends on how many
> dimensions you have. Rows and fields are specific to 2D arrays IMO.
>
> Darrell wrote:

Gman

2006-01-27, 6:56 pm

Haha!! Me too! Thank goodness for Mr Beban's array handling functions.

I use Excel for reporting a lot of the time, recordset > variant >
transpose > dump to Excel (sooooo much faster dumping a variant than
writing cell by cell).

RB Smissaert wrote:
> To keep things simple I usually transpose the array with one of Alan
> Beban's
> array functions.
>
> RBS
>
> "Gman" <nah> wrote in message news:uvHeIS5IGHA.3060@TK2MSFTNGP10.phx.gbl...
>
>
>

RB Smissaert

2006-01-27, 6:56 pm

Same here, except I do a lot of further manipulations on the arrays before
dumping to Excel.

RBS

"Gman" <nah> wrote in message news:ODgdtr5IGHA.676@TK2MSFTNGP10.phx.gbl...[color=darkred]
> Haha!! Me too! Thank goodness for Mr Beban's array handling functions.
>
> I use Excel for reporting a lot of the time, recordset > variant >
> transpose > dump to Excel (sooooo much faster dumping a variant than
> writing cell by cell).
>
> RB Smissaert wrote:
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com