Toma,

Here's a bit of code I use to do just that.

repeat for each line tPhrase in thePhrases]
    if matchChunk(fld "MyText", "(" & tPhrase & ")", tStartChar, tEndChar)
then
      set the textStyle of char tStartChar to tEndChar of fld "MyText" to
link
    end if
end repeat

Of course, you only have to use the repeat if you have multiple phrases.
The matchChunk function returns a Boolean true or false if the text is
found.  The parentheses are necessary to match a patter of multiple words.
The beginning and ending characters are stored in whatever variables you
specify, in this case tStartChar and tEndChar.  So then you just use those
in a chunk expression to set your link.

Hope that helps.

Chris Sheffield
Software Development
Read Naturally
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Toma Tasovac
Sent: Thursday, September 11, 2003 3:21 AM
To: [EMAIL PROTECTED]
Subject: multiple-word phrases, links

Hi there.

I have a list containing various multiple-word phrases and I want 
Revolution to find those phrases in a text field and turn them into 
links (the whole phrase, not individual words).  What's the best way of 
doing this?  I can use wordOffset for each individual word in the 
phrase and then make sure that the offsets are next to each other in 
the text, but that sounds horrible.  There has to be a better way.

Helplessly yours,

Toma

_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to