C-------------------------------------------------------------------------- subroutine ftgnxk(iunit,inclst,ninc,exclst,nexc,card,status) C Return the next keyword that matches one of the names in inclist C but does not match any of the names in exclist. The search C goes from the current position to the end of the header, only. C Wild card characters may be used in the name lists ('*', '?' and '#'). C iunit i Fortran I/O unit number C inclist c list of included keyword names C ninc i number of names in inclist C exclist c list of excluded keyword names C nexc i number of names in exclist C OUTPUT PARAMETERS: C card c first matching 80 character card image C status i returned error status (0=ok) C C written by Wm Pence, HEASARC/GSFC, January 1997 integer iunit,ninc,nexc,status,ii,jj character*(*) inclst(*),exclst(*),card character*80 keybuf logical casesn,match,exact card=' ' if (status .gt. 0)return casesn=.false. 10 call ftgcrd(iunit,'*',keybuf,status) if (status .le. 0)then do 30 ii = 1, ninc call ftcmps(inclst(ii),keybuf(1:8),casesn,match,exact) if (match)then do 20 jj = 1,nexc call ftcmps(exclst(jj),keybuf(1:8),casesn,match,exact) C reject this card if in exclusion list if (match)go to 10 20 continue C keyword is not excluded, so return it card = keybuf return end if 30 continue C didn't match, so go back to read next keyword go to 10 end if C failed to read next keyword (probably hit end of header) end