Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcnc!ece-csc!ncrcae!ncr-sd!hp-sdd!ucsdhub!jack!man!crash!jeh From: jeh@crash.CTS.COM (Jamie Hanrahan) Newsgroups: comp.os.vms Subject: Re: Help Request Message-ID: <1368@crash.CTS.COM> Date: Sat, 11-Jul-87 08:59:55 EDT Article-I.D.: crash.1368 Posted: Sat Jul 11 08:59:55 1987 Date-Received: Sun, 12-Jul-87 16:06:58 EDT References: <8707110230.AA28524@ucbvax.Berkeley.EDU> Reply-To: jeh@crash.CTS.COM (Jamie Hanrahan) Followup-To: comp.os.vms Distribution: world Organization: Crash TS, El Cajon, CA Lines: 23 Keywords: Fortran ENTRY %LOC Summary: ENTRY statement puts a label at the end of a procedure In article <8707110230.AA28524@ucbvax.Berkeley.EDU>,writes: >%LOC also works for external procedure names. The problem here is, that >while the name of a function indicates where it begins, there is no real >indication of where it ends. About the best you can do is use the address >of the next function defined in the same source file, ... VAX-11 FORTRAN supports the ENTRY statement, which allows you to define an alternate entry point within a procedure (subroutine or function). Thus, you can ... INTEGER*4 FUNCTION LOCKED_FUNC (ARG, ...) - - (declarations, code, etc.) - - ENTRY LOCKED_FUNC_END (ARG, ...) END Then, in your routine to lock the routine, just use %LOC(LOCKED_FUNC) and %LOC(LOCKED_FUNC_END) to get the addresses of the beginning and end of the procedure.