Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!psuvax1!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Dereferencing ProcPtr in LS Pascal Message-ID: <1486@husc6.harvard.edu> Date: 4 Feb 90 14:13:33 GMT References: <1268@diemen.cc.utas.oz> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Organization: Symantec Language Products Group Lines: 33 In article <1268@diemen.cc.utas.oz> brianh@tasis.UUCP (Brian Harrold) writes: >To all Light Speed pascal gurus, I have a simple (?) question. > > I have a procedure in which one of the parameters is of type > ProcPtr (pointer to another procedure). Is there any way in > LS Pascal to dereference the pointer to the given procedure, > and execute it ? Dereferencing a ProcPtr is a meaningless operation, since "procedure" isn't a data type. However, since we all know that a ProcPtr points to a procedure's code, it is possible to call it: PROCEDURE CallMyProcPtr(arg1 : Type1; arg2 : Type2;...argN : TypeN; addr : ProcPtr); INLINE $205F { movea.l (a7)+, a0 }, $4E90 { JSR (a0) }; to call it: CallMyProcPtr(arg1, arg2,...argN, @MyProcedure); R. ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel "When someone who makes four hundred and fifty dollars an hour wants to tell you something for free, it's a good idea to listen." ~~~~~~~~~~~~~~~