Path: utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!usc!ucsd!network.ucsd.edu!weber.ucsd.edu!pbiron From: pbiron@weber.ucsd.edu (Paul Biron) Newsgroups: comp.sys.mac.hypercard Subject: EvalExpr() callback in XCMDs Keywords: EvalExpr, XCMDs vs. Scripts vs. Msg Message-ID: <2608@network.ucsd.edu> Date: 8 Jul 90 01:41:59 GMT Sender: news@network.ucsd.edu Reply-To: pbiron@weber.ucsd.edu (Paul Biron) Organization: Division of Social Sciences, UCSD Lines: 50 Nntp-Posting-Host: weber.ucsd.edu Hi all, A while back I asked if there was a way to tell if an arbitrary object existed (e.g. if Exists (cd fld "foo") then ...). Numerous people pointed me to the Dartmouth XCMDs (vol 3) available from sumex. Well, I finally got them (thanx to all who helped with that), and eagerly jumped into the source for ObjectExists(). What I found has the rather simple : paramBlock^.returnVal = EvalExpr (CONCAT ('the name of '), paramBlock^.params[1]) ; (or the equivalent, I don't have the code in front of me at the moment). Why is it that this works in an XCMD and not in a script or from the message box? In a script or from the msg any reference to a non-existant object results in a Never heard of ... error box (even in HC 1.2.2). In all the references I own (or have looked at) the description of the EvalExpr() callback is that it does the same thing that would happen if its argument were typed in the msg. In the same vein, why is it that something like go card foo (where foo is a non-existant card) when typed into the msg will produce the above "Never..." error box, yet when in a script no such error occurs? Anybody know of anything else which works differently when typed in the Msg or called from a script (except for 'if', 'then', 'repeat', etc which are documented to *NOT* work when typed in the Msg)? Any help will be greatly appreciated. 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