Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!brunix!vali!man From: man@vali.cs.brown.edu (Mark H. Nodine) Newsgroups: comp.sys.mac.hypercard Subject: Re: Checking for card existance? Keywords: HyperCard, Booga-Booga-Booga Message-ID: <38641@brunix.UUCP> Date: 3 May 90 17:57:02 GMT References: <903@gistdev.gist.com> Sender: news@brunix.UUCP Reply-To: man@vali.cs.brown.edu (Mark H. Nodine) Organization: Brown Computer Science Dept. Lines: 27 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!" How about function verifyCard theID put the short id of this card into cardID push this card go card id theID put (the short id of this card is not cardID) into answer pop card return answer end verifyCard I just made this up on the spot, but I know the technique works, since I've used it before. In other words, the code may be flawed, but the technique is OK. --Mark