Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!bellcore!ulysses!cbosgd!ucbvax!YALE.ARPA!LEICHTER-JERRY From: LEICHTER-JERRY@YALE.ARPA Newsgroups: mod.computers.vax Subject: Re: DCL function F$SEARCH Message-ID: <8605131027.AA20061@ucbvax.Berkeley.EDU> Date: Tue, 13-May-86 06:28:14 EDT Article-I.D.: ucbvax.8605131027.AA20061 Posted: Tue May 13 06:28:14 1986 Date-Received: Wed, 14-May-86 00:41:53 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: LEICHTER-JERRY@YALE.ARPA Organization: The ARPA Internet Lines: 24 Approved: info-vax@sri-kl.arpa [The following code works fine when P1 contains a wildcard, loops forever otherwise:] $LOOP: $ FILE = F$SEARCH(P1) $ IF FILE .EQS. "" THEN EXIT $ WRITE SYS$OUTPUT FILE $ GOTO LOOP Tim Pearson, Astronomy Dept, Caltech, Pasadena 91125, USA Misfeature? That's just the way it works - when there are no wildcards in the argument, F$SEARCH resets itself immediately; you never get the null that signals "no more arguments". A workaround - ugly, but what can you do - is: $ PREVIOUS_FILE = "" $LOOP: $ FILE = F$SEARCH(P1) $ IF FILE .EQS. "" THEN EXIT $ WRITE SYS$OUTPUT FILE $ IF FILE .EQS. PREVIOUS_FILE THEN EXIT $ PREVIOUS_FILE = FILE $ GOTO LOOP -- Jerry -------