Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mailrus!hellgate.utah.edu!helios.ee.lbl.gov!ucsd!network.ucsd.edu!weber.ucsd.edu!pbiron From: pbiron@weber.ucsd.edu (Paul Biron) Newsgroups: comp.sys.mac.hypercard Subject: an exists(object) function ? Keywords: HyperTalk Message-ID: <2308@network.ucsd.edu> Date: 25 Mar 90 23:21:42 GMT Sender: nobody@network.ucsd.edu Reply-To: pbiron@weber.ucsd.edu (Paul Biron) Organization: Division of Social Sciences, UCSD Lines: 52 One of the most annoying things about HyperTalk is that there is no exists() function. By this I mean something that could be used in the following mannor : on foo repeat with cardNum = 1 to the number of cards if exists("card button bar") then set the rect of card button bar to 100,200 else put "card button bar does not exist on" && -| the long name of this card end repeat end foo Sure, this can be simulated by : function exists object put word 3 to word the number of words in -| object of object into objectName if word 1 of object is "card" then if word 2 of object is "button" then repeat with i = 1 to the number of card buttons if the short name of card button i -| is objectName then return true end repeat else if word 2 of object is "field" then ... else .... end exists but this is highly inefficient, and not very general (what about "cd btn bar", "btn number X", etc.). Does anyone know of a better way to do this? Perhaps an XFCN? My first guess is that there is no such external, since the file structure of stacks has not been made public, and one would have to be reading the file structure to do something like this. I know its too late, but my wish list for the next release of HyperCard contains such a function. Paul Biron (pbiron@ucsd.edu) (619) 534-5758 Social Sciences DataBase Project, Central University Library University of California, San Diego La Jolla, Ca. 92093