Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!jdevoto From: jdevoto@Apple.COM (Jeanne A. E. DeVoto) Newsgroups: comp.sys.mac.hypercard Subject: Re: Checking for card existance? Summary: use the result Keywords: HyperCard, Booga-Booga-Booga Message-ID: <40749@apple.Apple.COM> Date: 4 May 90 22:02:23 GMT References: <903@gistdev.gist.com> Organization: Apple Computer Inc, Cupertino, CA Lines: 28 In article <903@gistdev.gist.com> andy@gistdev.gist.com (Andy Warinner) writes: >I have a field that stores the id of a card. Is there any way to >check that the id stored actually exists? For example: > > -- bkgnd field "cardPtr" holds card id > if verifyCard(bkgnd field "cardPtr") > then go to card id (bkgnd field "cardPtr") > else answer "You screw up!" If you try to go to a non-existent card from a script, the result function will return a non-empty value. The following will do the check: go card ID XXX if the result is not empty then -- do failure procedure else -- do success procedure -- if you just wanted to check for existence, not go to the card, -- you can put a "go recent card" in here to get back to where you -- were. end if -- ========= jeanne a. e. devoto ======================================== jdevoto@apple.com | You may not distribute this article under a jdevoto@well.sf.ca.us | compilation copyright without my permission. ______________________________________________________________________ Apple Computer and I are not authorized | CI$: 72411,165 to speak for each other. | AppleLink: SQA.TEST