File Search Loops
$ IF FSP .EQS. “” THEN GOTO EXIT_LOOP_1
$ IF SV_FSP .EQS. “” THEN SV_FSP = FSP
$ IF FSP .EQS. SV_FSP THEN GOTO EXIT_LOOP_1
To avoid locked loops, check that the filespec.
Returned by F$SEARCH() is not the same as the
Notes:
Here’s an example of a loop which uses F$SEARCH.
Note that if the search specification is not wildcarded, F$SEARCH will return the same string over and over. The example shows how to avoid locked loops by saving the filespec after each invocation and comparing the previous string to the current string. If they match, exit the loop.