Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcnc!ece-csc!ncrcae!ncr-sd!hp-sdd!ucsdhub!sdsu!mccurdy From: mccurdy@sdsu.UUCP (Mike McCurdy) Newsgroups: comp.os.vms Subject: Re: DCL scoping of labels in subroutines Message-ID: <2631@sdsu.UUCP> Date: Thu, 2-Jul-87 16:48:19 EDT Article-I.D.: sdsu.2631 Posted: Thu Jul 2 16:48:19 1987 Date-Received: Sat, 4-Jul-87 10:59:40 EDT References: <8707011941.AA06570@mitre.arpa> Organization: San Diego State University, Math/Sciences Dept. Lines: 22 Summary: Use gosubs instead In article <8707011941.AA06570@mitre.arpa>, stansbury%mwvms@MITRE.ARPA writes: > -------- > scoping of labels in command procedures. When this command procedure is > invoked on a VMS V4.5 system and you answer 1 to the first prompt and 2 to > the second, you get the following error message: > %DCL-W-USGOTO, target of GOTO not found - check spelling and presence of label > > when DCL attempts to execute the > > $ if c .ne. 3 then goto a1_start ! a1 If a 2 is entered in response to the second prompt, the "If c ..." statement will never be encountered. You will receive an -UNDEFINED SYMBOL error as you branch into a different procedure level for the C variable. You can simplify things by using GOSUB's instead of CALL's. Mike McCurdy San Diego State University None of this should be held against me.