Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!galen!leue From: leue@galen.crd.ge.com (Bill Leue) Newsgroups: comp.sys.mac.hypercard Subject: Re: if there is ... at [xx,yy] Message-ID: <17959@crdgw1.crd.ge.com> Date: 27 Mar 91 21:58:25 GMT References: <12497@pt.cs.cmu.edu> Sender: news@crdgw1.crd.ge.com Organization: General Electric Research & Development Lines: 33 In article <12497@pt.cs.cmu.edu> kem@h.gp.cs.cmu.edu (Kenneth Mohnkern) writes: >I guess HC2.0's "there is" doesn't have the ability to check if >there's an object at a certain point. The manual doesn't cover >"there is" very well. I think it's only mentioned in a table of >functions (or commands? properties?) I tried "If there is a bg >btn at 442,42 then beep". I got an error message. > >Is there another way around this? I'd like to look at a specific >location and see if there's a button there without looking at >every button and comparing its loc with the desired loc. > >I know if there's a cool way to do this I'll find it here. It's pretty easy. First, find out if the object exists. Next, if it exists, get its location properties and test them against your requirements. if there is a then get the TopLeft of -- or some other location property if it is then -- the object exists at the desired location else -- it exists, but not at the desired location end if else -- it doesn't exist at all end if -Bill Leue leue@crd.ge.com