The button "colorLines" creates and names a new field "xxx". It then tries to select and color lines 2 and 3, waiting just a bit between those steps. This is an exercise to show the difference between the "selectedLines" and the "selectedChunk" in this process, derived from another recent thread.
I challenge anybody to tell me what is going on here, and especially to "clear" the field of all color. If you can, please tell me how.
Here is the handler in btn "colorLines".
Code: Select all
on mouseUp
if there is a fld "xxx" then delete fld "xxx"
wait 30
create fld "xxx"
set the rect of fld "xxx" to "50,50,200,200"
put "AAAA" & return & "BBBB" & return & "CCCC" & return & "DDDD" & return & "EEEE" into fld "xxx"
wait 40
select line 2 to 3 of fld "xxx"
set the backcolor of the selectedChunk to "255,215,255"
wait 40
set the backcolor of the selectedlines to "255,215,255"
wait 40
set the backcolor of fld "xxx" to "255,255,255"
end mouseUp