How to I get clickItem?

J. Landman Gay jacque at hyperactivesw.com
Sun Aug 31 15:40:01 EDT 2003


On 8/31/03 1:01 PM, Bill Vlahos wrote:

On 8/31/03 1:01 PM, Bill Vlahos wrote:

> I have a field in which the itemDelimiter is numToChar(255) instead
> of return. This allows me to have items with multiple paragraphs in
> the same item.

Items can always have paragraphs in them. Items don't end until either 
the next item delimiter is encountered or the text runs out. If the 
itemDelimiter isn't a return character, then many paragraphs can be part 
of the same item.

> How can I get the item number when a user clicks on the field? The 
> clickLine correctly returns the line number but that doesn't tell me
>  what item it is. What I want is a clickItem function which doesn't
> exist (or at least I can't find it).

Like this:

   get the clickChunk
   set the itemdelimiter to numToChar(255)
   put the number of items in char 1 to (word 2 of it) of fld <fldName>

Note that the clickChunk will return 0 if the user clicks in the empty 
space after the text.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



> How can I get the item number when a user clicks on the field? The 
> clickLine correctly returns the line number but that doesn't tell me 
> what item it is. What I want is a clickItem function which doesn't exist 
> (or at least I can't find it).

   get the clickChunk
   set the itemdelimiter to numToChar(255)
   put the number of items in char 1 to (word 2 of it) of me

Items don't end at a return character, they only end when the text runs 
out or another delimiter is returns become part of the item they are in. 
So this should work fine.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list