File extension is in extensions list: Difference between revisions

m
m (→‎{{header|REXX}}: added/changed comments and whitespace, used a template for the output, aligned the output better, optimized the inner DO loop.)
m (→‎{{header|Fortran}}: Crosslink...)
Line 475:
 
=={{header|Fortran}}==
The plan is to use the extractor function for file name extensions that was defined in [[Extract_file_extension#Fortran|another problem]] to obtain the extension's text, then use that text to index a character string of approved extensions. These are defined with the period included, but no extension's text can include a period - all start with a period and continue with letters or digits only - so the specification of a list of such items need not mess about with quotes and commas and so forth. The deed is done via function EXTIN(FNAME,LIST), but there is a lot of support stuff in the absence of an existing library to call upon.
 
When the task was revised to include a # as a possible character in the file name extension part, the scan in FEXT that allowed only certain characters via GOODEXT required changing. One possibility was to increase the size of GOODEXT so as to encompass the three characters in ODDITIES, that includes a #. But it also includes a : (all this is from a different context) and in file names, under DOS, this character is special. So, all-in-all, it seemed better to retreat from exclusions and simply allow all characters, as per the original specification. This done, the function EXTIN that checked that the extension was one of a specified set seemed no longer restricted to file name extensions, so instead it became FOUND(TEXT,LIST) and the period, the only special character now, is used as the delimiter in LIST.
1,220

edits