Path: utzoo!utgpu!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!rutgers!mailrus!purdue!decwrl!bagels.dec.com!harrow From: harrow@bagels.dec.com (Jeff Harrow, NMSG LKG2-2/Y10 DTN=226-5564) Newsgroups: comp.sys.mac.programmer Subject: Executing a code segement from Lightspeed Pascal? Message-ID: <8810051239.AA09466@decwrl.dec.com> Date: 5 Oct 88 12:39:21 GMT Organization: Digital Equipment Corporation Lines: 63 I've got a programming question (which will show my weakness in Pascal... Oh well) I'm trying to use the HelpCompiler that came over Usenet. It places help text and a CODE resource into a program, which you call with the following "C" code: #include ShowHelp() { Handle rsrcH; ProcPtr pp; if (rsrcH = GetResource('CODE', 2000)) { HLock(rsrcH); pp = (ProcPtr) *rsrcH; (*pp)(); ReleaseResource(rsrcH); } } Now, I tried to convert this to Pascal (Lightspeed, of course) as follows: procedure ShowHelp; var rsrcH : Handle; pp : ProcPtr; begin if rsrcH = GetResource('code', 2000) then begin HLock(rsrcH); pp := @rsrcH; pp; <<<<