Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!NAIF.JPL.NASA.GOV!PJS From: PJS@NAIF.JPL.NASA.GOV (Peter Scott) Newsgroups: comp.os.vms Subject: CALLs and SUBROUTINEs Message-ID: <880422114821.0000009E131@naif.JPL.NASA.GOV> Date: 22 Apr 88 19:48:21 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 32 Okay, so I started to get into subroutines, everything was going great until I ran up against a problem that I boiled down to this: if I run the following command procedure: ------------------------------------------------------------------------ $ CALL a $ EXIT $ ! $ a: SUBROUTINE $ d = 1 $ loop: $ CALL c $ d = d + 1 $ GOTO loop $ EXIT $ ENDSUBROUTINE $ ! $ b: SUBROUTINE $ EXIT $ ENDSUBROUTINE $ ! $ c: SUBROUTINE $ EXIT $ ENDSUBROUTINE ------------------------------------------------------------------------ then after the line "CALL c", both d and loop are undefined (you can take loop out if you want, I was just illustrating that labels are affected too). However, if I remove subroutine B, everything goes swimmingly. (In the original file, B was called later on.) What is going on??? How can I lose the scope of my pseudo-procedure just by calling subroutine c? Should I write an SPR? Peter Scott (pjs%grouch@jpl-mil.jpl.nasa.gov)