Table Fields

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

Table Fields

Post by churchken » Sat Oct 27, 2007 6:37 pm

Hi,

I can't seem to find any reference documentation on using table fields without data bases.

Can individual cells of a table field be referenced to manipulate contents, background color, and text color?

Thanks for any help in pointing me in the right direction.

Ken

Lynn P.
Posts: 79
Joined: Sun Apr 09, 2006 1:09 pm

Post by Lynn P. » Sun Oct 28, 2007 4:36 pm

Hi Ken ~

You can refer to each cell by using "line" and "item" after setting the itemdelimitor to TAB, since table fields are plain old fields separated by lines and using tabs.

To change the text color a cell (1,1) for example:

set the itemdel to TAB
set the textColor of item 1 of line 1 of fld "myTable" to red

To change the contents of a cell (2,3):

set the itemdel to TAB
put "34.95" into item 2 of line 3 of fld "myTable"

I'm not sure about changing the background color of individual cells or if it's possible as I've never tried it, but I'm sure someone has and will come along with that info.

churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

Thanks, Lynn

Post by churchken » Sun Oct 28, 2007 7:31 pm

Lynn,

Thanks a bunch for the tips --

I tried to find info in the documentation, searched the user guide and the forum too, but did not find anything. The doc's said cells are referred to by row and column, (separated by a comma) but I did not find a way to make that work either.

I did find the line and "word" approach to work, but only if there were already data in each "word" before the target cell.

Again, thanks for your assistance.
Ken

Post Reply