selecting lines in a field

Eric Chatonet eric.chatonet at sosmartsoftware.com
Sun Feb 17 05:52:42 EST 2008


Hi Tim,

Assuming a field I put in:

Clear
---
Choice 1
Choice 2
Choice 3
---
Choice 4
Choice 5
etc.

And in the script of the field:

on mouseDown
   local tHilitedLines
   -----
   lock screen
   put the hilitedLines of me into tHilitedLines
   if tHilitedLines = 1 then
     set the hilitedLines of me to empty
     -- clear
   else
     repeat with i = the number of items in tHilitedLines down to 1
       if line (item i of tHilitedLines) of me = "---" then
         delete item i of tHilitedLines
       end if
     end repeat
     set the hilitedLines of me to tHilitedLines
   end if
   unlock screen
end mouseDown

Hope this helps.
BTW if the above works, I'm not sure it's really compliant with usual  
guidelines on any platform ;-)

Best regards from Paris,
Eric Chatonet.

Le 17 févr. 08 à 01:43, Timothy Miller a écrit :

> Hi,
>
> After all these years, still a beginner... sigh...
>
> A multi-line field. Locked. Focusable. Autohilite and listbehavior  
> are true. Normally, I'd turn on "multi-line" and "non-continguous"  
> and I'd be good to go. Later on, a script will get the hilitedlines  
> of this field.
>
> Except...
>
> I use "---" as a separator, and some lines are deliberately blank,  
> for the sake of readability.
>
> If I click on "---" or a blank line, I'd like to leave that line un- 
> hilited, without disturbing the other hilitedlines in the field.
>
> --also--
>
> Line 1 = "Clear"
>
> If I click on line 1, I'd like to set all the hilitedlines to  
> false, including the hilite of line 1.
>
> I think I know the necessary commands and properties, though one  
> can't be certain in my case. I've realized I might need to turn off  
> the mulit-line or non-contiguous property and script some field  
> behavior manually. I've tried various possibilities by trial and  
> error, but I can't seem to put the pieces together. Now I'm stuck.
>
> Please advise.
>
> Thanks in advance,
>
> Tim

----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list