Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!uw-beaver!uw-june!moore From: moore@cs.washington.edu (Charles Moore) Newsgroups: comp.sys.mac.hypercard Subject: Is PasToZero necessary? Keywords: XCMD's, PasToZero Message-ID: <12477@june.cs.washington.edu> Date: 6 Jul 90 08:05:58 GMT Organization: U of Washington, Computer Science, Seattle Lines: 22 Is a call to PasToZero necessary in order to return a result to Hypercard from an XCMD? The appendix to the HyperCard Script Language Guide is pretty cagey about this saying only that the returnValue field of the XCmdBlock can contain a handle to a zero-terminated string. But where is the space for this string allocated? I allocated space within my XCMD with the declaration: char resultStr[80]; and then tried to return this value with the assignment: paramPtr->returnValue = (Handle)&resultStr; The result was a system error. Does this mean that PasToZero, in addition to converting between string types, also commands HyperCard to allocate space for the converted string? If so, why must I use PasToZero? I already have a zero-terminated string. I don't need to convert it; I just need to return it. Where is the glue routine that has HyperCard allocate some space and copies your string into that space but that doesn't waste time doing unnecessary conversions? Charles Moore