table calculations
Jan Schenkel
janschenkel at yahoo.com
Wed Jun 4 08:56:01 EDT 2003
--- Klaus Major <klaus at major-k.de> wrote:
> Hi all,
>
> now we have this very promising table object in RR 2
> :-)
>
> Could someone please give a short example on how to
> create a real spreadsheet-like functionality.
>
> I mean a simple example how to calculate the sum
> etc...
> of some cells and put it into another cell.
>
> Please don't tell me that i will have to parse the
> complete
> field and check/collect items like i already did in
> my cheap
> AXEL-triple-X-Lite stack here ;-)
> ...
> set the itemdel to TAB
> repeat for each... etc...
> if... etc...
> ...
>
> There must be a better way...
>
> Maybe i missed this in the dox, but i did not found
> anything
> about that...
>
> Thanks a lot in advance.
>
>
> Regards from (extremely hot) germany
>
> Klaus Major
> klaus at major-k.de
>
Hi Klaus,
I'm afraid you'll get a bit warmer because it's not
built-in ; however, if you feel adventurous, you could
hack the revTable frontscript to suit your needs.
A cursory look at that frontscript shows that its
handler 'revWriteCellValue' might be a good place to
hook onto : it is called whenever a cell is filled in
with data.
So if you add something like this to it :
set the uTableCellData[pRow,pColumn] of \
pObject to pValue
that gives you an extra custom property set with dtaa
per cell.
And then you can :
put the customProperties["uTableCellData"] \
into tTableCellDataA
and do interesting things with that array.
Hopefully the next iteration of RunRev will give us
more control over the data and send us a few messages
(such as cellChanged) -- or maybe more will be
implemented in the MetaCard engine.
Hope this gets you started,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
More information about the use-livecode
mailing list