I have a simple scrolling field list of 10 lines of text.
I want to display something on the right hand side of the card when each item
on the list is selected e.g. when line 1 of the scrolling field list is selected, display "this is the first line of text"
when the line 2 of the scrolling field list is selected display "You have selected the second line in the list" etc.
			
			
									
									
						Scrolling List Field - code for each item
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
- 
				abanowBUSTfGf
 - Posts: 63
 - Joined: Sat Dec 22, 2012 3:01 am
 
Re: Scrolling List Field - code for each item
Hi abanowBUSTfGf,
The hilitedlines should be the trick.
Best regards
Jean-Marc
			
			
									
									The hilitedlines should be the trick.
Code: Select all
on DoCommentList
   put the hilitedlines of field "myField" into tLineHi
   if tLineHi = empty then exit DoCommentList
   put empty into tCommentLine
   repeat for each item tNoLine in tLineHi
      put line tNoLine of field "fCommentLine" & cr after tCommentLine -- a field with one comment per line
   end repeat
   delete char -1 of tCommentLine
   put tCommentLine
end DoCommentListJean-Marc
https://alternatic.ch
						Re: Scrolling List Field - code for each item
Hi abanowBUSTfGf,
you really should get the basics of Livecode as explained in the Scripting Conferences!
I think I mentioned this before
 
Put this into the script of the listfield:
Look up "hilitedlines" in the dictionary!
And maybe stack "Controls" from the "Scripting Conferences"!
 
Best
Klaus
			
			
									
									
						you really should get the basics of Livecode as explained in the Scripting Conferences!
I think I mentioned this before
Put this into the script of the listfield:
Code: Select all
on mouseup
  put the hilitedlines of me into tHL
  put "You selected line:" && tHL & "!" into fld "the other field"
end mouseupAnd maybe stack "Controls" from the "Scripting Conferences"!
Best
Klaus
