Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!spray!anson From: anson@spray.CalComp.COM (Ed Anson) Newsgroups: comp.sys.mac.hypercard Subject: Re: Two Questions (1 HyperTalk, 1 XCMD's)... Message-ID: <2600@spray.CalComp.COM> Date: 20 Feb 89 16:08:50 GMT References: <685@gould.doc.ic.ac.uk> Reply-To: anson@spray.UUCP (Ed Anson) Organization: CalComp, A Lockheed Company, Hudson, NH, USA Lines: 26 In article <685@gould.doc.ic.ac.uk> np@doc.ic.ac.uk (Nigel Perry) writes: >(b) In XCMD/XFCN's is there an official/recommended way of storing globals >between calls to the XMCD? I see "Menus for HyperCard" (code in Dan >Shaffers book) store stuff in the hc msg window stucture.The copy >of Menus I have stores stuff in resources non-purgable in memeory. >I thought of storing data by patching a little used trap (InitPacks?) >to be a jump to the original followed by a handle to my data. The OFFICIAL way to store globals is to convert the data to text and store it in a HyperCard global. HyperCard provides call-backs for the purpose. Personally, I don't like that idea, since it can be a major performance problem, not to mention a pain in the ... You CAN store stuff in non-purgeable resources. But there are some severe drawbacks. The most serious is that HyperCard closes your current resource file (the stack) when you move to another stack. The resource may or may not be in the file when you come back, and if it is, it may or may not be valid data. Your idea of patching a trap may be on the right track. -- ===================================================================== Ed Anson, Calcomp Display Products Division, Hudson NH 03051 (603) 885-8712, anson@elrond.CalComp.COM