C---------------------------------------------------------------------- subroutine fttrec(string,status) C test the remaining characters in a header record to insure that C it contains only pri-ntable ASCII characters, C i.e., with ASCII codes greater than or equal to 32 (a blank) C and less than or equal to 126 (tilda). C Note: this will not detect the delete character (ASCII 127) C because of the difficulties in also supporting this check C on IBM mainframes, where the collating sequence is entirely C different. C Dec 1996: since support for non-ASCII character sets has C been dropped, the test for characters greater than 126 C has been restated. C string c*72 keyword record C OUTPUT PARAMETERS: C status i output error status (0 = ok) C optimized in 7/93 to compare "ichar(string(i:i)) .lt. space" C rather than "(string(i:i)) .lt. ' ' " C This is much faster on SUNs and DECstations, C and decreases the time needed to write a keyword (ftprec) by 10%. C This change made no difference on a VAX integer space,tilda C the following 2 lines are only correct for machines that use ASCII parameter (space = 32) parameter (tilda = 126) character string*(*) integer status,i character pos*2 if (status .gt. 0)return do 20 i=1,72 if (ichar(string(i:i)) .lt. space .or. & ichar(string(i:i)) .gt. tilda) then C illegal character found status=207 write(pos,1000)i 1000 format(i2) call ftpmsg('Character #'//pos//' in this keyword value or '// & 'comment string is illegal:') call ftpmsg(string) return end if 20 continue end