H
Henri =?ISO-8859-15?Q?Schom=E4cker?=
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
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