\u001a is an end-of-file character in scripts

Difference between version 3 and 4 - Previous - Next
As of Tcl [Changes in Tcl/Tk 8.4%|%Tcl 8.4], the [ascii] 'substitute' character
(`\032`, `\u1a` , control-Z) signifies the end of the script on all platforms.


** See Also **

   [working with binary data]:   



** Description **

There are a few reasons Tcl recognizes [ascii] 'substitute' character as the
end of a script. First, it improves script portability between [Microsoft
Windows%|%Windows] and other systems.  Prior to this change, the 'substitute'
character signified the end of the script on Windows, but not on other
platforms.  It was felt that it would be better to make the handling consistent
on all platforms.

Second, it is generally useful to be able to store additional data directly
after the script. A [Starkit], for example, is a script followed by the
'substitute' character followed by a [Metakit] database.  The Tcl interpreter
doesn't pay any attention to what is beyond the substitute character, and thescript can access the additional data. [baseTclkit%|%Other single-file Tcl
applications] have also put this behavior to good use.

To escape the special meaning of the 'substitute' character, encode it as a
`\x`
or `\u` [substitution].

<<categories>> Characters | File | Syntax