Re: Vector Table

From: Howard (alicebt_at_hotmail.com)
Date: 12/06/04


Date: Mon, 06 Dec 2004 17:13:55 GMT


"kittykat" <f_arikat@nospam.hotmail.com> wrote in message
news:7dbab6890c631f1d8cf2079a4a68f71a@localhost.talkaboutprogramming.com...
> Do all the elements of a Vector Table? have to be of the same data type?
> for example, could it have rows with letters, and columns with integers?
>
> 0 1 2 3 4 5 6
> A
> B
> C
> D
>

You're not making much sense here. What's a "Vector Table"? What you're
showing above is a display of "headers" for columns and rows of some sort of
data table. But there is no data displayed in any of the "cells". Your
questions ask about two unrelated things.

"Do all elements have to be the same type?" Well, that depends upon what
you mean by "type". You can store strings in the cells, and those strings
can be numbers or letters or puncuation or whatever. Alternatively, you can
have a vector of vectors (or an array of arrays, if you want to do things
the hard way and not make use of the std classes). Then, each vector can
hold a given type of data (such as integer, string, char, double). Or, you
can store a base class object in every cell, and let polymorphism handle the
details of what's in the cell and how to display it.

But none of that has anything to do with "rows" or "columns". That's all up
to how you output the data (to a screen, for example). You merely write out
the data however you want. Just because you have an array X[4][5] doesn't
mean there are four "rows" and five "columns", or vice-versa. You're free
to display those however you want.

And how you display the "headers" for those rows or columns is also
completely up to you. You don't even have to store that information
anywhere. When outputting the data, you can simply write the "column" index
across the top of the page, and when writing each row out, you can simply
add the "row" index to the value for the letter 'A' to generate the other
letters.

The important thing is really what you're trying to display as data in the
actual cells, which you haven't said.

-Howard



Relevant Pages

  • Re: Count unique if text
    ... (The data array having 1 more element than the bin ... Mike F ... it looks like this if the news reader will display ... cells in the range, but in my column there are many blank cells and the ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Display Dynamic Range
    ... I still don't know how to DISPLAY the result without copying the ... The Daily_Postage array changes every day. ... Daily Postage is 12 x 500 array of cells each with a formula or ... sheet2 without spreading formulas around in each cell. ...
    (microsoft.public.excel.worksheet.functions)
  • Calculating average values of an array under certain conditions
    ... I have a question about an array I want to analyze and edit, ... Some cells are empty ... then do not display cells. ... NOT the empty cells of course. ...
    (comp.soft-sys.matlab)
  • My data table has extra spaces
    ... How can I get rid of extra blank spaces or cells in my columns? ... if I have a column with 26 numbers in it and the next column has letters "a b c d & f" in the column. ... the data will display 1-26 correctly but the column with the letters will display ...
    (microsoft.public.access.gettingstarted)
  • cell address
    ... i have an array in cells f8:n16 with letters across top row and numbers ... i am trying to retrieve. ...
    (microsoft.public.excel.programming)