Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!tektronix!reed!langford From: langford@reed.UUCP (Chris Langford) Newsgroups: comp.sys.mac.hypercard Subject: if-statement problem(?) Keywords: if repeat Message-ID: <10537@reed.UUCP> Date: 6 Oct 88 22:58:48 GMT Organization: None, I work alone... Lines: 50 Hi, I have been writing in hyperTalk for a while, and there is a problem I have run into several times. When I try to run scripts that contain if statements with this format: on mouseUp repeat with i = 1 to the number of cards if field 1 of cd i contains "RTFM" then foobar end if end repeat end mouseUp -- where foobar is any command or set of commands I get an error message that says "No such card". The problem is fixed if I write the script: on mouseUp repeat with i = 1 to the number of cards get field 1 of cd i if it contains "RTFM" then foobar end if end repeat end mouseUp or like this: on mouseUp repeat with i = 1 to the number of cards go cd i if field 1 contains "RTFM" then foobar end if end repeat end mouseUp The second correction takes longer to run than the first, but I think the original script would run even faster, if it worked (one less line). Am I missing something completely, or is this a problem with HC? Has anyone else run into this problem? Thanks for any help. -- Chris Langford | tektronix!reed!langford | "And to everyone else out there, langford@reed.bitnet | the secret is to bang the rocks | together, guys."