Xref: utzoo comp.sys.mac.programmer:13215 comp.sys.mac.hypercard:3351 Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!Teknowledge.COM!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer,comp.sys.mac.hypercard Subject: Need Help (info) on XCMDS Keywords: xcmd, xfcn, quickbasic Message-ID: <10143@unix.SRI.COM> Date: 15 Mar 90 20:10:59 GMT Reply-To: mxmora@sri-unix.sri.com (Matt Mora) Followup-To: comp.sys.mac.programmer Organization: SRI International, Menlo Park, CA Lines: 93 I am in the process of writing a library routine for Quickbasic that will allow you to call XCMD's & and XFCN's from any quickbasic program. The part that is tripping me up is the callback part. For example: (using the code below supplied by apple's XCMDUtils) function StringMatch; begin with paramPtr^ do begin inArgs[1] := ORD(@pattern); inArgs[2] := ORD(target); request := xreqStringMatch; DoJsr(entryPoint); StringMatch := Ptr(outArgs[1]); end; end; where DoJsr is: PROCEDURE DoJsr (addr : ProcPtr); INLINE $205F, $4E90; {MOVEA.L (A7)+,A0} {JSR (A0)} When the library code starts I set entrypoint to be the address of the procdure to handle the callback. for example paramPtr^.entryPoint:=@CallbackHandler; How do I return control to the xcmd from my callbackhandler? RTS? Now when I actually call the xcmd after filling in then paramptr block, can I just do: myXCmdhndl:=GetNamedResource('XCMD',Xcmdname); if myXCmdHndl<> nil then begin Hlock(myXCmdHndl); DoJSR(myXCmdHndl^^); HunLock(myXCmdHndl); ReleaseResource(myXCmdHndl); end; end; or will this blow up in my face :-) And some other random questions. What exactly is a zero string. Is that a C string? And when I do ZeroToPas, Do I truncate the string if its > 255? Thanks for any clues you can give me. -- ___________________________________________________________ Matthew Mora SRI International mxmora@unix.sri.com ___________________________________________________________