table calculations

Jan Schenkel janschenkel at yahoo.com
Thu Jun 5 01:09:00 EDT 2003


--- Klaus Major <klaus at major-k.de> wrote:
> Hi Jan,
> 
> at first a short question:
> 
> Do you ever sleep?
> 
> Before one can read a question on this list,
> you already posted a smart solution... ;-)
> 
> Not that i would mind...
> 
> Or are you able to clone yourself, like Scott R. did
> sometimes in the past ;-)
> 
> (Maybe he passed this ability over to Tuviah S.
> in these days...)
> 
> Please don't answer that question if it will hurt
> any
> (inter-)national securitiy-issues...
> 

Hehehe, I do sleep, but not very much : since I
upgraded my regeneration alcove from MacOS9 to MacOSX
efficiency has tripled. (*)
As for cloning, that's the sort of thing Steve Jobs is
trying to do with his iPods -- thought that was a
fifties movie? just wait until those hatch...

Yes, my favourite website is back on a regular
schedule : 'As the Apple Turns' (www.appleturns.com)
-- if you need something to grin/smile/laugh about,
that's the place to go.

> [snip]
> 
> > 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.
> 
> I was afraid it wasn't that easy :-)
> 
> Thanks a lot, your suggestions will make me start.
> 
> 
> Regards
> 
> Klaus Major

Glad to be of assistance. However, depending on the
goal, it might be more interesting to go with the
approach of multiple fields.

One of the things this allows you to do :
  put field "column1" into tRows
  split tRows using return
  put sum(tRows) into tSum
On the other hand, if you need the average of an
entire row, this doesn't help and you'll have to
iterate over the fields yourself.

Though if you don't care about redundancy, you can
make things easy on yourself by adding :
  set the uTableColumnData[pRow] of pObject to pValue
  set the uTableRowData[pColumn] of pObject to pValue
to the hack on revWriteCellValue.

As always, there's more than one way to skin a cat...

Have fun !

Jan Schenkel.

(*) Actually, my reply was so late due to my falling
asleep right after dinner last night, heh.

=====
"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