Table Field Docs?
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Tue May 10 13:32:50 EDT 2005
Hi Peter,
You are right and, for instance, have to clear some properties set by
the engine to store the table contents when you want to clear a table
field.
I'm working on a How-To stack about table fields including some answers
you requested like fixing the number of columns when tabbing across and
much more :-)
I hope it will be ready at the end of this week.
on ClearTable pLongID
-- pLongID parameter is the long ID or the long name of the table
field
do "put empty into" && pLongID
do "set the cRevTable[currentView] of" && pLongID && "to empty"
do "set the cRevTable[formattedView] of" && pLongID && "to empty"
end ClearTable
Le 10 mai 05, à 18:42, Peter Reid a écrit :
> Hi Frank
>
> Thanks for the response. Unfortunately your recommendations only work
> for ordinary fields not table ones. The problem is that when you
> start editing into cells, the field text property is clearly NOT being
> used to hold the edited cells. From other messages on the list it
> seems that hidden data structures are used for this.
>
> This is why I'm after some documentation - how to I get at the hidden
> data structure to read/write/empty under script control?
>
>> put tableContent into field "Table Field" -- put data into
>> complete table
>> put field "Table Field" into tableContent -- get complete table
>> data
>>
>>> - clear a table
>>
>> put empty into field "Table Field"
>>
>>> - address individual cells for reading/writing
>>
>> set the itemDelimiter to tab -- the
>> lines in a table field have the columns separated by tabs
>>
>> put 6 into item 5 of line 7 of field "Table Field" -- row 7, column
>> 5
>> put item 3 of line 2 of field "Table Field" into mycell -- row 2,
>> column 3
>>
>>> - fix the number of columns when tabbing across
>>
>> not sure what you mean by this one?
>>
>>> - have table column headings that scroll as the data table scrolls
>>
>> Hmm, you could put the headings in another table immediately above
>> the one they belong to, set the tabStops the same, eliminate the
>> scrollbars, make it non-editable, and put a bit of code in the main
>> field ("Table Field") to keep the horizontal scrolling in sync. I
>> did something like this with an experimental stack I had started at
>> one point.
>>
>> Then you could format the other table field however you want.
>
> Yep, I've done this use-another-table-for-the-headings trick but it's
> clunky and I hoped that a "spreadsheet like" object might actually
> support proper column headings?!
Eric Chatonet.
----------------------------------------------------------------
So Smart Software
For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch
----------------------------------------------------------------
Web site http://www.sosmartsoftware.com/
Email eric.chatonet at sosmartsoftware.com/
Phone 33 (0)1 43 31 77 62
Mobile 33 (0)6 20 74 50 86
----------------------------------------------------------------
More information about the use-livecode
mailing list