On Wed, Mar 24, 2004 at 07:22:35AM -0500, CBFalconer wrote:
Frank Heckenbach wrote:
Scott Moore wrote:
Well, first I must say that this is a point where I consider the standard broken. (E.g., I have a text editor written in Pascal, and I want it to be able to handle files with or without trailing EOLn's, without appending them either when reading or writing the files.)
I agree, and heartly recommend the method used in IP Pascal for this, which is completely ISO 7185 compatible. The ISO rules only specify the special handling on files of "text". A declaration "file of char" (which text was originally defined to be equivalent to in Wirth prestandard) is, as allowed in the standard, truly a linear file of characters. This gives any program wanting %100 control of its output format that ability.
That's true, but it has some drawbacks. First, you have to deal with different line endings yourself then. Second, it may be less comfortable, and also less efficient (reading a char vs. a line at a time).
IIRC 'text' is not a reserved word, only a predefined type. Thus the question devolves to "what is that type". If we redefine it, are the text files input and output still available in the affected scopes? Are input and output predefined as text files?
Yes, IMHO. As usual in Pascal, shadowing a type name has no effect on variables possesing the type.
Emil