Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!oakhill!tomj From: tomj@oakhill.UUCP (Tom Johnson) Newsgroups: comp.sys.mac.hypercard Subject: Using FIND in scripts Message-ID: <3118@oakhill.UUCP> Date: 20 Mar 90 14:28:04 GMT References: <9223@sdcc6.ucsd.edu> Reply-To: tomj@oakhill.UUCP (Tom Johnson) Distribution: usa Organization: Motorola Inc., Austin, Texas Lines: 46 Once again, I don't seem to be able to make sense of something (not an unusual occurance, I assure you). This time, I'm having problems with the FIND command. Given the following scenario: 1) stack with 3 backgrounds 2) button "testFind" on bg 1 contains script below 3) card field "test" on bg 2 contains the string "abc" 4) card field "test1" on bg 3 contains the string "def" The script is: on mouseUp push card ask "Find what?" go bg {2} -- insert appropriate bg name here for bg 2 find it in field "test" if the foundText = "" then put "empty" else put the foundText pop card end mouseUp The problem: 1) If I put any of: {word | string | whole} "abc", the find works, and the msg box contains "abc" 2) If I put any of: {word | string | whole} "def", the find works, and the msg box contains "def". 3) If I put any of: {word | string | whole} "ghi", the find fails and the msg box contains "empty". I think that case 2 above **shouldn't** work! I specifically tell the find command to look for a match ONLY in field "test", but it finds the string in field "TEST1". This causes a REAL pain, since I must check in my script to verify that the foundChunk is on the card where the field I wanted to search lives every time I issue the find command. Am I reading the documentation wrong? Is there something obvious (or even not so obvious) I am missing? Incidentally, this is under HC 1.2.5 running on a Mac II/cx (8 Mb/80Mb), system 6.0.4, finder 6.1.4 (the one with "put away"). As always, thanks for any assistance in advance. Tom Johnson (tomj@oakhill.UUCP) Standard disclaimers apply.