It appears that on 2/1/00 12:07 PM, Nicolas R Cueto [EMAIL PROTECTED] 
wrote:

>The text is already delimited, with a "/".


You could pre-process the text to apply the group style, creating an 
associative array along the way to make it easy to extract the 
appropriate values. Assuming that the "/" comes after the space between 
sentences, this button handler would do the pre-processing, assuming that 
the text you want to process is in field "one" and the target (clickable) 
field is "two":

on mouseUp
  global soundList
  put fld "one" into fld "two"
  put 1 into startChar
  put 1 into theSound
  repeat
    put offset("/",fld "two") into theSlash
    if theSlash is 0 then exit repeat
    set the textStyle of char startChar to theSlash-2 of fld "two" to 
"Group"
    put char startChar to theSlash-2 of fld "two" into theKey
    put theSound & ".au" into soundList[theKey]
    add 1 to theSound
    delete char theSlash of fld "two"
    put theSlash into startChar
  end repeat
end mouseUp

This results in a global array, soundList. This script in field "two" 
will result in the appropriate sentence number ("1.au" "2.au" etc.) being 
placed in the message box:

on mouseUp
  global soundList
  put soundList[the clickText]
end mouseUp

Obviously, you might not want to use the _whole_ sentence as the key, and 
this doesn't account for identical sentences, but that's doable.

gc

This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm

Reply via email to