home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7616 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.3 KB  |  31 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!jeffbyrn
  3. From: jeffbyrn@mp.cs.niu.edu (Jeff Byrne)
  4. Subject: Re: Calling Local Procedures - SOLVED -
  5. Message-ID: <1992Dec22.060852.16456@mp.cs.niu.edu>
  6. Organization: Northern Illinois University
  7. References: <1992Dec21.233611.1711@mp.cs.niu.edu> <1992Dec21.235322.21824@mp.cs.niu.edu> <dmurdoch.241.724993410@mast.queensu.ca>
  8. Date: Tue, 22 Dec 1992 06:08:52 GMT
  9. Lines: 20
  10.  
  11. Hi,
  12.   Well my problem is solved thanks to Duncan Murdoch.  He explained that
  13. a local procedure differs from a regular procedure only by the addition
  14. of a hidden word sized parameter containing the calling procedure's [BP].
  15.  
  16. This is easy to fake by changing the procedure type declaration:
  17. Type
  18.   LocalMethodType = Procedure (P : PTestObj); { Procedure Type }
  19. becomes:
  20.   LocalMethodType = Procedure (P : PTestObj; BFrame : Word);
  21.                                          {   ^- This gets [BP] }
  22. The solution I tried before worked (sort of) because it was pushing the
  23. correct number onto the stack.  However, they were in the wrong order.
  24.  
  25. Thanks again to Duncan.  If anyone is interested in a fixed version of
  26. my simple test program just send me some e-mail.
  27. Happy Holidays -
  28. - Jeff
  29. jeff@mp.cs.niu.edu
  30. jeff@art.niu.edu
  31.