number of columns in a table field
Richard Gaskin
ambassador at fourthworld.com
Wed May 31 12:18:01 EDT 2006
Jonathan Lynch wrote:
> And, independent of the the engine's size limit on a subgroup, there is also
> the problem of moving around that many objects...
>
> Say you have a pseudo-table with 3000 rows, and you insert a row between
> rows 1 and 2 - the engine then has to go through and rename rows 2 through
> 3000, and reposition them in order to make space for row 2.
>
> This is not instantaneous.
In any language. ;)
> I have thought of another method, using only enough rows to be visible in
> the table, and storing all the rest of the data in custom props - then, when
> you scroll, it would actually just reassign the information in each row.
> Such a thing would be tough to implement so that it actually looks like
> normal scrolling, but I think it could be done.
One of the challenges in using Rev effectively is that it does such a
good job of hiding the deep nasty work needed to get stuff done from us
that we often forget how complex these things are under the hood.
What we're talking about here would be a custom list definition in any
lower-level language. List defs are complex beasts.
One thing we can learn from list defs (in addition to a healthy
appreciation for the enormity of the task and how relatively simple Rev
makes it) is that, generally speaking, they often work much as you describe.
For example, a spreadsheet has only two elements in it: a custom list
definition to display the rows and columns, and a single editable text
field positioned as needed for in-cell editing.
In the Rev world, the ease of working with fields may seduce us to
forget how complex field objects are, tempting us to use a field for
every cell. And for small numbers of cells that works, and well -- but
with larger numbers it exhibits the performance issues you note.
Extending that idea to use graphics in a list for display, and having a
single row group for editing makes a lot of sense. It may take some
time to set up, but will be more efficient -- it's closer to how one
would solve the problem in a lower-level language.
--
Richard Gaskin
Managing Editor, revJournal
_______________________________________________________
Rev tips, tutorials and more: http://www.revJournal.com
More information about the use-livecode
mailing list