file,variable,array,split

mark mitchell cowhead at mac.com
Wed Sep 25 12:14:01 EDT 2002


Toma wrote:

> Along the same lines of what we've been doing here with reading files 
> into
> variables or custom properties and then turning them into arrays, what 
> if I
> wanted to have two words associated with each clickedWord: i.e. If 
> it's a
> verb, I want to have the clickeWord retunr both its infinitive AND the
> translation.

I guess you are doing something a bit more complicated where you have to 
import the data as a separate file etc.  But the most straight-forward 
way to accomplish the above is to use the 'linkText'.  You can set the 
link text of a word or word group (set their textFont to "link") to 
anything you like.  You can then return the entire linkText or just 
pieces thereof, at your whim.  e.g.  You might set the linktext of the 
word "eat" to:

eat,ate,eaten
taberu,tabeta,tabete ita

And then you can have a script that says something like:
global theTense
if theTense is past then
get the selectedChunk
put item 2 of line 1 of the linkText of it && "=" && item 2 of line 2 of 
the linkText it into myField
end if

and so on.  The above would return just "ate = tabeta".

I've asked before but I still don't know how the linkText compares to a 
custom property in terms of efficiency.  I used to use custom props, but 
switched to linkText because it seems more robust (allows editing of the 
clickword without destroying access to the linked text).

good luck,

mark mitchell
Japan




More information about the use-livecode mailing list