Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!ukma!rutgers!apple!dan From: dan@Apple.COM (Dan Allen) Newsgroups: comp.sys.mac.hypercard Subject: Re: Garbage collection in XCMDs Keywords: Handle Message-ID: <19782@apple.Apple.COM> Date: 1 Nov 88 03:04:51 GMT References: <2795@uvacs.cs.Virginia.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 16 In article <2795@uvacs.cs.Virginia.EDU> hsd@uvacs.cs.Virginia.EDU (Harry S. Delugach) writes: >I am a beginner at creating XCMDs in LSC 3.0. I am implementing a few >of my choice Home stack interpreted functions. I am still learning simple >string manipulation; how to allocate enough space for the return string, etc. >Each time my XFCN is called, I allocate a new Handle for a return value, >which I then fill up with a zero-terminated string. My question is: how does >that handle ever get disposed of? If I dispose of it before exiting the >XFCN, that just throws away my return value. Is there a way to mark the >handle for later purging? An excellent question indeed. The good news is that you need not do anything: HyperTalk automatically disposes of the handle that you pass back as the function result for XFCNs! Dan Allen Software Explorer Apple Computer