Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!rutgers!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: How do you execute a CODE resource? Message-ID: <15185@unix.SRI.COM> Date: 14 Aug 90 16:22:19 GMT References: <1990Aug14.003350.2055@vaxa.cc.uwa.oz.au> <1990Aug14.131735.21771@ux1.cso.uiuc.edu> <1348@anaxagoras.ils.nwu.edu> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 47 In article <1348@anaxagoras.ils.nwu.edu> engber@gumball (Mike Engber) writes: >Let's say you have a few CODE resources and you want to execute >them (ala XCMDS in Hypercard). How do you do it? > >I can get as far as opening the resource file, getting handles >to the CODE resources, but I don't know where to go from there? > Try something like this in pascal; procedure DoJsr (addr: ProcPtr); inline $205F, $4E90; procedure executecode(myhandle:handle); var addr:procptr; begin HLock(myhandle); addr := procptr(myhandle^); DoJsr(addr); hunlock(myhandle); end; The key of course is the inline procedure. I found the Dojsr from the hpercard interface stuff I think. -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________