Path: utzoo!attcan!uunet!oddjob!uwvax!husc6!ukma!psuvm.bitnet!gfx From: GFX@PSUVM.BITNET Newsgroups: comp.sys.mac.hypercard Subject: Re: A good book for desscribing nitty gritty of XCMDs and language use Message-ID: <43294GFX@PSUVM> Date: 25 May 88 04:02:41 GMT References: <50895@sun.uucp> <4015@zodiac.UUCP> <10899@apple.Apple.Com> Distribution: comp Organization: The Pennsylvania State University - Computation Center Lines: 47 >There is no REALLY good book on XCMD writing. The best current source >is APDA. There is a disk with some sample XCMDs in C and Pascal with a >bit of brief on-disk documentation. I have been introduced to XCMDs syntax by the XCMD.SIT available from Borland's forum. The examples provided are relatively clear, except for the correct procedure one should use to pass arrays, instead of single parameters to XFCNs. Which source would be the most appropriate and how do we get it? Eg. -> I have been especially puzzled by the following: PROGRAM test; $R- $U- $D PasXFCN USES MemTypes, QuickDraw, OSIntf, HyperXCmd; PROCEDURE PasXFCN(paramPtr:#XCmdPtr); (* THE # SHOULD READ AS A CARET *) VAR str : Str255; $I Xcmdglue.Inc BEGIN; zeroToPas(paramPtr#.params[2]#,str); (* THE # SHOULD READ AS CARET *) paramPtr#.returnValue := PasToZero(str);(* THE # SHOULD READ AS CARET *) END; BEGIN END. If called with: Put test(1,2) into someContainer the XFCN returns 2, as expected. However, if the string 1,2 is in a container, a call such as: Put test(field someField) into someOtherContainer returns garbage of the form : W>>W>>W>> (etc.) What happens? Can someone tell me how to transfer arrays residing in HYPERCARD fields to an XFCN, and back? ------- Stephane Gauvin : GFX@PSUVM : (814) 237-4979 : Compuserve 73057,1763 Interests: Marketing: New products, Mathematical Models, Game Theory Computing: AI, MacIntosh, Hypercard