Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
put the hilitedline of widget "pgDetails" of stack "ArtistOutputSheet" into tLine
set the itemDelimiter to tab
put line tLine of the pgText of widget "pgDetails" of stack "ArtistOutputSheet" into tData
repeat with x = 1 to the number of lines in tData
put item 1 of tData & cr into tList
end repeat
answer tList
There is tsvData for the polygrid, you can set and get tsvData of a polygrid.
The first line is the column headers.
That is one way to get at your data, here it seems to be the easiest way.
on mouseUp
put the tsvData of widget "pgDetails" into tData
set the itemDelimiter to tab
repeat with i = 1 to the number of lines of tData
put item 1 to 2 of line i of tData & return after tCollect
end repeat
delete char -1 of tCollect # a return
## I reset the itemDelimiter, not necessary here but in longer scripts
## it is easy to forget that the itemDelimiter is not comma
set the itemDelimiter to comma
## tCollect contains your result as tabbed list
put tCollect into message box
end mouseUp
There is tsvData for the polygrid, you can set and get tsvData of a polygrid.
The first line is the column headers.
That is one way to get at your data, here it seems to be the easiest way.
on mouseUp
put the tsvData of widget "pgDetails" into tData
set the itemDelimiter to tab
repeat with i = 1 to the number of lines of tData
put item 1 to 2 of line i of tData & return after tCollect
end repeat
delete char -1 of tCollect # a return
## I reset the itemDelimiter, not necessary here but in longer scripts
## it is easy to forget that the itemDelimiter is not comma
set the itemDelimiter to comma
## tCollect contains your result as tabbed list
put tCollect into message box
end mouseUp
Kind regards
Bernd
Hi Bernd,
thanks again for helping me out
question what is the use of delete char -1? i tried to use the toggle breakpoint so that i can see if there will be changes noting change or i guess i just overlook the code.
thank you very much you help me simplified my code thanks
lemodizon wrote: Tue May 28, 2024 3:58 pm
question what is the use of delete char -1? i tried to use the toggle breakpoint so that i can see if there will be changes noting change or i guess i just overlook the code.