Odd word problem: Difference between revisions

Line 744:
hot,star.
</pre>
The basic ploy is that the function returns the next character from the input, but, should DEFER be true, it secretly invokes itself until a non-letter is found then returns (bearing that non-letter as its result) and on the way back out, secretly writes the letter previously read. Each level of recursion has its own version of that letter and by revealing them as the returns proceed, they are written in reverse order of input. Seen from the outside of GET, the value of DEFER is always ''true'' but this variable is static with regard to the invocations of GET, it being defined outside GET. If it were defined within there would be a new instance allocated with each level of recursion (as with variable C), which is not what is wanted.
 
Testing showed that the F90 feature of <code>ADVANCE="NO"</code> was required for the READ action because the $ format code that works for output does not work for input. Should an end-of-record interfere with the READ, the <code>EOR=''label''</code> is taken, and the character read will be a space. To avoid ugly system messages on running into end-of-file, character zero is reserved, just as a space is reserved for end-of-record encounters and skipped for output. Fortunately, the specification does not include spaces as allowed input. No checks are made as to whether the input conforms to the given specifications.
1,220

edits