Again: 2D-Array/Table but sortable asc/desc by column for different datatypes

Discussion in 'C++' started by Henri =?ISO-8859-15?Q?Schom=E4cker?=, Dec 17, 2005.

  1. Hi folks,

    what I need is a kind of 2D-Array which should, in the end, represent a
    typical html-table and which should be sortable by column.

    I thought of an implementation, where an vector does not keep
    the rows, as usual, but holds the single _columns_ as lists.

    In this case, every column could have it's own datatype, just like
    database-tables and could be sortable by the list's sort function.
    Another advantage would be, that you would be able to calculate with values
    of different columns of the same datatype just like with a spreadsheet
    without having to convert datatypes.
    For formated output a "format" function converts all fieldvalues into string
    and formats them to return a, for example, html-table.

    But the longer I think about it, the more difficulties come in my mind:
    When sorting one column, how do I record and bind the resulting sort-order
    of that column to the other columns?

    Unfortunately I'm not so advanced in c++ and after reading for three days
    now about matrices and 2D-arrays in c++, I still have no clue how I could
    realise the sort-by-column function. Althought I think some similar kind of
    matrix must be used in every simple spreadsheet application, I couldn't
    find any examples for this kind of matrix/table.

    Maybe I should also mention that the solution must compile on Unix/Linux as
    well as on Windows.

    Perhaps some of you could give me some hints, examples or links how I could
    realise my table-object? Or perhaps you already have realised something
    like that before?

    Many thanks in advance,
    every little hint is very welcomed,
    yours Henri
    Henri =?ISO-8859-15?Q?Schom=E4cker?=, Dec 17, 2005
    #1
    1. Advertising

  2. Hi again,

    many thanks for your attention if you read this.
    Fortunately, I now found the right way after some more reading and trying.

    Again, many thanks for your attention,
    yours Henri
    Henri =?ISO-8859-15?Q?Schom=E4cker?=, Dec 17, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VSK
    Replies:
    1
    Views:
    570
  2. Jimakos Bilakis
    Replies:
    9
    Views:
    269
    Ben Pope
    Mar 27, 2006
  3. Teej
    Replies:
    2
    Views:
    285
  4. ngoc

    desc $table in DBI Oracle

    ngoc, Aug 1, 2005, in forum: Perl Misc
    Replies:
    15
    Views:
    468
    Marcus Eric Harris
    Aug 29, 2005
  5. Replies:
    6
    Views:
    504
Loading...

Share This Page