Re: Declaration of INDEXED file



>>PS. I wonder what happens if you don't have an INVALID KEY on a read and
>>don't have a DECLARATIVES section for the file?

> ...or a file status test.

> It continues with the next sentence

Technically that is incorrect. 'next sentence' has a specific meaning
being the point following the next full stop. You meant 'next
statement'.

ANS'85 specifies that "The INVALID KEY phrase or the AT END phrase must
be specified if no applicable USE procedure is specified for the file
name." This means that it should generate a compiler error (and thus
not run). It is a common extension to allow this to be ignored but the
run time behaviour may also vary and this may depend on compiler
options and/or vendor preferences.

For example with no INVALID KEY and no USE a failing READ may just set
an appropriate file status. If there is also no file status then it is
likely that the program will stop with an error message.

.