Path: utzoo!attcan!uunet!cs.utexas.edu!asuvax!mcdphx!udc!willcox From: willcox@urbana.mcd.mot.com (David A Willcox) Newsgroups: comp.sys.mac.hypercard Subject: Re: XCMD's cannot set global variables. Message-ID: <1266@urbana.mcd.mot.com> Date: 25 May 90 13:37:03 GMT References: <3707@darkstar.ucsc.edu> Organization: Motorola Microcomputer Division, Urbana, IL Lines: 19 In article <3707@darkstar.ucsc.edu> sirkm@ssyx.ucsc.edu (Greg Anderson) writes: >I believe that the book "XCMD's for HyperCard" by Gary Bond mentions that >XCMDs cannot create global variables. His solution, if I recall, is to >create a new button (from within the XCMD), give it a script that references >the global variable & then do a callback to it. Am I missing something? I don't have any documentation available here at work, but I could swear that there are a pair of callbacks called something like GetGlobal() and SetGlobal() that let you get and set globals from an XCMD. I've used them, and they work. It's the only way I know of to keep some memory around between invocations of an XCMD. (Allocate a handle, convert its address to something ASCII, store it in a global.) David A. Willcox Motorola MCD - Urbana UUCP: ...!uiucuxc!udc!willcox 1101 E. University Ave. INET: willcox@urbana.mcd.mot.com Urbana, IL 61801 FONE: 217-384-8534