Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!pasteur!agate!shelby!portia.stanford.edu!johner From: johner@portia.Stanford.EDU (John Lynch) Newsgroups: comp.sys.mac.hypercard Subject: Re: XCMD's cannot set global variables. Message-ID: <1990Jun3.151129.24268@portia.Stanford.EDU> Date: 3 Jun 90 15:11:29 GMT References: <1266@urbana.mcd.mot.com> <3821@darkstar.ucsc.edu> <1269@urbana.mcd.mot.com> Organization: AIR, Stanford Universit Lines: 19 In article <1269@urbana.mcd.mot.com> willcox@urbana.mcd.mot.com (David A Willcox) writes: >My conclusion - If you have a "modern" version of HyperCard, then you >can create globals from within an XCMD/XFCN; the "global" in your >script is not necessary. If you have an old version of HyperCard, the >"global" is necessary. Sounds to me like a bug that has been fixed. > Just a note: You need to declare them in Supercard also. At least, you do if you are going to access them explicitly from Supertalk. In other words, if you create a dummy global just to use from your XCMD, like XXX_My_Global, then only acces it from an XCMD, you are fine, i.e. you get the necessary storage and the XCMD can find it. But if you explicilty use it in Supertalk when it was created from an XCMD, it usually can't find it the first time. In fact, if you acces it within a callback from the XCMD, you often crash. Whoops. Point is, if using Supercard, declare globals you expect to set from an XCMD. John Lynch Trilogy Development Group