Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!cs.utexas.edu!usc!ucsd!network.ucsd.edu!weber!pbiron From: pbiron@weber.ucsd.edu (Paul Biron) Newsgroups: comp.sys.mac.hypercard Subject: Re: EvalExpr() callback in XCMDs Keywords: the result, EvalExpr(), MsgBox vs. script vs. XCMD Message-ID: <2614@network.ucsd.edu> Date: 10 Jul 90 04:44:39 GMT References: <1388taylorj@yvax.byu.edu>,<2608@network.ucsd.edu> Sender: news@network.ucsd.edu Reply-To: pbiron@ucsd.edu (Paul Biron) Organization: Division of Social Sciences, UCSD Lines: 43 Nntp-Posting-Host: weber.ucsd.edu In article <1388taylorj@yvax.byu.edu> taylorj@yvax.byu.edu writes: >In article <2608@network.ucsd.edu>, pbiron@weber.ucsd.edu (Paul Biron) asks >>why using EvalExpr for the Exists function in the Dartmouth collection >>works from the XFCN but not from HyperCard. > >The difference is that X-commands have error results returned to them, as >opposed to an error dialog popping up. This is so that the X-command can >handle the error appropriately without bothering the user. The writer of >the Exists XFCN brilliantly took advantage of this. > >The "go to non-existant card" thing works the same way. An error message is >returned in "the result" instead of a dialog popping up so that a script >can handle things without user intervention. > >Jim Taylor >Microcomputer Support for Curriculum | >Brigham Young University | Bitnet: taylorj@byuvax.bitnet >101 HRCB, Provo, UT 84602 | Internet: taylorj@yvax.byu.edu It would be nice if it were this simple; however, it is not! The behavior you describe does happen with references to non-existent *CARDS*, but not with *ANY* other kind of object (e.g. buttons or fields). My initial need for the ObjectExists() XCMD was a case where I needed to know whether a certain named *BUTTON* existed. In the case of reference to a non-existent *BUTTON* [from the MsgBox or from a script but *NOT* thru a callback with EvalExpr()] an error dialog is called up!!!! Perhaps Winkler et. al. had intended to make the behavior the same for cards, buttons, fields, etc but they did not. Again, does anyone (perhaps someone from Apple) have any explanation for why this is so? Paul Biron pbiron@ucsd.edu (619) 534-5758 Central University Library, Mail Code C-075-R Social Sciences DataBase Project University of California, San Diego, La Jolla, Ca. 92093