Is the clickCharChunk my friend?

Eric Chatonet eric.chatonet at sosmartsoftware.com
Tue Sep 23 13:12:32 EDT 2008


Bonsoir Graham,

Le 23 sept. 08 à 18:18, Graham Samuel a écrit :

> Thanks Eric, to the rescue again!

NP :-)

> It seems counterintuitive to me that the selectedChunk returns a  
> meaningful result when nothing is selected, e.g. when the cursor is  
> flashing in a field but none of its contents are highlighted, or it  
> is even empty! Similarly to use 'select' to put the focus and the  
> cursor back into an empty field (and therefore in fact to select  
> nothing) doesn't look very intuitive either. But it works, I have  
> to admit!

Just not that if your global (since you made the choice to put the  
selectedChunk into a global) is empty, do "select" &&  
gRememberedInsertionPoint will mean 'select empty'.
As for me I avoid using globals as soon as I can (probably because I  
write plugins where a variable could shadow another one in the user  
environment ;-)
Have a look at script local variables and custom properties also:  
accessing them is really fast.

> Thanks
>
> Graham
> On Tue, 23 Sep 2008 13:44:26 +0200, Eric Chatonet  
> <eric.chatonet at sosmartsoftware.com> wrote:
>>
>> Bonjour Graham,
>>
>> The clickCharChunk function returns a chunk expression of the form
>> char charNumber to charNumber of field fieldNumber:
>>  it's not a point you can click at.
>> Anyway, probably you might prefer to store the selectedChunk instead
>> and use do "select" && gRememberedInsertionPoint
>> This will not only position the insertion point but restore a
>> possible selection.

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list