spreadsheet-like tables
Alex Tweedly
alex at tweedly.net
Sat Jul 9 07:28:00 EDT 2005
Jon wrote:
> I want to port a simple (!) program that has a "database record" for
> each row in a user viewable (and possibly editable) table. The data
> may have to be sorted in more than one fashion, and some fields may
> have to have different colored backgrounds or text. Some fields
> might be editable in the table, while other fields (memos) might be
> edited in a single field at the bottom, where the current record has
> the memo contents displayed (I hope this is clearly explained). Given
> that I have no compatible databases on my Windows system (that I know
> of!), I may not actually choose to use a database, but perhaps some
> other approach (text file(s), multiple cards (something I do not
> understand very well), etc)..
>
> So. Two questions.
>
> First off, what is the best way to present the user with tabular
> data? I tried the "table", and it has lots of problems, at least the
> way I did it <sick grin>. Any sample stacks out there for me to
> study? I had the most trouble allowing the user to edit the data: the
> appearance of the table went to hell when the user started modifying a
> field in the table.
If you can live with one limitation, I think the easiest answer is to
use Chipp's altHeader plugin. It provides headers for columnar data,
allows for resizing of the columns, makes it easy (or automatic - I
don't remember) to sort by different columns, etc. Only thing I wanted
and didn't find was column re-ordering (i.e. selecting the third
column's heading, and drag-and-dropping it to make it now be the fifth
column).
The limitation is that, as far as I know, you can't have different
fields in different colours - though it may be possible to program that
yourself.
You mentioned "memo" fields - I'd be inclined to keep them out of the
tabular display completely, so that only the "current" record has its
memo field(s) displayed at the bottom.
> Secondly, are there any simple databases that "come with" Windows?
> Any freebie databases that can be (easily?) installed on Windows? Any
> resource I should have consulted before posting this
> probably-redundant question?
>
How much data do you have to deal with ? You can go a long way with CSV
files (actually, use TABs or some other character that won't appear in
your data, not commas, as your separator - makes things much easier),
and the speed of text manipulation and searching in Rev will allow this
to scale quite a long way.
I wouldn't use the "data on cards" approach - I like to keep data and
code separate, and to have the data in a format that can be readily
accessed by other tools if needed.
You should look at SDB (Serendipity Database-Binary). I have failed
utterly to get it to work for me, in spite of trying seriously 3 or 4
times - but I know others have succeed, so it may be just me that thinks
differently and can't understand the docs, or my system set-up that is
peculiar, or something. (If ever there was a product that needed a
detailed step-by-step set of instructions for installing it, SDB is it.
I would have a go at writing it - except that I can't figure it out well
enough to do it myself :-) So if you try this and succeed - you owe me
a write-up on the exact steps you took ....
Alternatively, stretching the definition of "simple", install MySQL or
PostgreSQL. Free (beware mySQL ceases to be free if your app is a
commercial app, in some complicated way), and both come well packaged
for Windows, and with lots of books, articles, support available, etc. -
but not quite "simple".
Or pay a modest sum for altSQLite.
Or write your own extneral to interface to sqlite.
Or .....
or just use CSV files :-)
--
Alex Tweedly http://www.tweedly.net
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.11/44 - Release Date: 08/07/2005
More information about the use-livecode
mailing list