Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!nrl-cmf!ames!pasteur!agate!violet.berkeley.edu!edmoy From: edmoy@violet.berkeley.edu Newsgroups: comp.sys.mac.hypercard Subject: Re: XCMD help needed Keywords: XCMD XFCN states global data Message-ID: <7105@agate.BERKELEY.EDU> Date: 22 Feb 88 01:22:00 GMT References: <515@hscfvax.harvard.edu> Sender: usenet@agate.BERKELEY.EDU Reply-To: edmoy@violet.berkeley.edu.UUCP () Organization: University of California, Berkeley Lines: 26 In article <515@hscfvax.harvard.edu> beamlab@hscfvax.UUCP (850103@D.McCallie) writes: > Is it possible to write an XCMD that remembers (internally) >data between invocations ? In other words, can I have states associated >with an XCMD so that the first call is treated differently from >subsequent calls ? I haven't tried it yet, but if you create a resource (say of type 'DATA') in the stack, then you could do a GetResource() every time your XCMD is called. By making it nonpurgeable, the data would remain intacted. The latest state of the resource could be saved permenently by calling ChangedResource(). > A similer question: is it possible to have external global >data that is shared between separate XCMDs, or must I send such >info back to HC itself (and thus require the stack author to >create stack "global" variables. If the XCMDs shared the same knowledge of the resource, then the resource can be used to pass global info. Edward Moy Workstation Software Support Group University of California Berkeley, CA 94720 edmoy@violet.Berkeley.EDU ucbvax!violet!edmoy