"find" fiasco

Friedrich F. Grohmann shedrup at ms9.hinet.net
Thu Oct 20 11:39:13 EDT 2005


I have a rather simple stack with text in fields on a number of cards 
(Rev 2.6 under Mac OS 10.3.2). The text is in Chinese. 

In order to look for other instances of a term found on the present card 
(in fld ID 1003) I'm using a "find selection" button the script of which 
is as follows:

on mouseUp
  put the selectedText of fld ID 1003 into SelCh
  go to cd "Single Line" of stack "Message Box"
  put "find" && quote&SelCh&quote into fld "Message Field"/
     of cd "Single Line" of stack "Message Box"
  select after text of fld "Message Field" of cd "Single Line" of stack 
"Message Box"
end mouseUp

I'm not sure whether there is anything wrong with this script but the 
following things happen:

1) With some words, the first instance (on the present) card is indicated 
by the box and with each further hit of the return key one proceeds to 
the next card where the term is found.

2) In the case of other words, the instance on the present card is not 
identified and only one other card is found, although the term actually 
occurs on a number of cards.

3) There are still other words in case of which the response is simply 
"not found".

4) I've run into so far one case where no instance is indicated and I am 
told

          Script compile error:
          Error: Script: missing "" after literal

5) There was another word, where no box was drawn at all but all 
instances were found. 

This scenario is very bewildering, to say the least. Is there any mistake 
in the logic of the script or do I miss some other subtle detail? Any 
help highly appreciated.

Fritz



More information about the use-livecode mailing list