I tested the widget “Table” but it seems have many troubles.
The big problem is that i can’t read every line of it:
put the line 1 of widget “Table” into tData => is OK
but put line 2 of widget “Table” into tData => return an empty value
Other problem is that i can’t set text of it to a multidimension (row and col) array
I don’t know if is a bug or a my error but it seems the widget is wrong and obviously without a minimal documentation is impossible for me find an answer.
put the tableText of widget "table" into tData
put line 5 of tData into tLine
set the text of widget "myInput" to tLine
this is for a single column text in widget “table”
To access the same line via array:
put the dataArray of widget "table" into tDataArray
put the number of lines of the keys of tDataArray into tNumLines
put tDataArray[5]["col 1"] into tLine5
set the text of widget "myInput" to tLine5
The dataArray was auto generated when I set the tableText to a list of lines.
Note that in this example the number of lines of the keys of tDataArray are not used but show how to get at the number of elements of the array.
To set the data of the table widget I used this for a two column data set
put the colorNames into tColorNames
put line 1 to 10 of tColorNames into tCol1Names
put line 1 to 10 of tColorNames into tCol1Names
repeat with i = 1 to 10
put line i of tCol1Names & tab & line i of tCol2Names & cr after tCollect
end repeat
delete char -1 of tCollect -- last char is a return
set the tableText of widget "table" to tCollect
Again 2 columns same as above using tab delimited data
put the colorNames into tColorNames
put line 1 to 10 of tColorNames into tColum1Data
put line 11 to 20 of tColorNames into tColum2Data
repeat with i = 1 to 10
put line i of tColum1Data into tArrayData[i]["col 1"]
put line i of tColum2Data into tArrayData[i]["col 2"]
end repeat
set the dataArray of widget "table" to tArrayData
Very good Bernd. Your help was precious. Now i want to use table rather than dropdown to create a combobox that is missing. Now i i ask you another effort to help me, can you explain something similar to table for a mysql database connection/list record/update and write recod? Sorry but looking into LC documentation for me is not clear.
Thank you again