Cells and tables

Richard Gaskin ambassador at fourthworld.com
Tue Oct 21 15:48:27 EDT 2003


Pär Lindgren wrote:

> Den 03-10-21 19.00, skrev "Richard Gaskin" <ambassador at fourthworld.com>:
> 
>> Paul Malloy wrote:
>> 
>>> Am I correct in understanding that you cannot refer to
>>> a cell in a table field in RR, except as "item xx of line xx of field xx"?
>>> This seems to contradict the documentation, which uses the "cell" term and
>>> says a cell can be referred to by row,column...
>>> 
>>> And is this line failing not because of "then" but because of "cell", so the
>>> error message is misleading?

It occurs to me that the error report may not be as misleading as much as
the interpreter is merely confused:  then conditional expression is failing
because it doesn't know what to do with the comparison expression.


> Haven't found any documentation on "cell".
> As I understand it you refer to cells in the table this way:
> Put word 2 of line 3 of cd fld "theTableName" into x,
> 
> Item reference doesn't work if you don't set the item delimiter, maybe?,
> haven't tried that.

Yes - the example I posted was:

  set the itemdel to tab
  if item 1 or line 1 of fld 1065 is not empty then

ItemDel and lineDel let you slice and dice tabular data gracefully and
flexibly.  Using tabs is especially nice in Rev because of the table
appearance given when the vGrid is set to true.
 
> Before using a table it seems necessary to fill the cells with spaces or
> something else, otherwise the reference to a particular cell that is
> preceded with an empty cell won't be found in the right spot.

A non-existent "cell" will return empty, just as it would if it existed but
contained no data.

For putting items, Rev will pad data to accomodate expressions.  For
example, if you run this:

  set the itemdel to tab
  put "AA" into item 3 of line 3 of fld 1

...and your field is empty at the outset, it will now contain three lines
with the third item in the last one being "AA".

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 Developer of WebMerge: Publish any database on any Web site
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc



More information about the use-livecode mailing list