Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!rutgers!apple!dan From: dan@Apple.COM (Dan Allen) Newsgroups: comp.sys.mac.hypercard Subject: Re: Testing card existence by name Message-ID: <24979@apple.Apple.COM> Date: 29 Jan 89 23:53:30 GMT References: <2064@iitmax.IIT.EDU> Distribution: usa Organization: Apple Computer Inc, Cupertino, CA Lines: 25 In article <2064@iitmax.IIT.EDU> nestor@iitmax.IIT.EDU (John Nestor) writes: >I would like to test whether a card of a given name exists in a stack >using hypertalk. There must be an easy way to do this, but I sure can't >find anything. My current hack is to do a linear search of the cards in >the stack, but this is painfully slow. Have I overlooked a better way? Try: go card foo if the result = "no such card" then beep where foo is the name of the card and beep could easily be replaced with whatever special thing you wanted to do. Dan Allen ** dan@apple.COM (Unix mail) Software Explorer ** ALLEN.DAN (AppleLink) HyperCard Team ** 20525 Mariani Ave. MS 22AE Apple Computer ** Cupertino, CA 95014 *********************************************************** ** Sam: "You know what they say, 'You can kill more ** ** flys with honey than with vinegar.'" ** ** Woody: "I don't mean to butt in, but you can kill ** ** the most with dead squirrels." ** ***********************************************************