Thread overview
End of file: end of medium?
Apr 03, 2006
Luís Marques
Apr 03, 2006
pragma
Apr 03, 2006
Luís Marques
Apr 03, 2006
BCS
Apr 03, 2006
Regan Heath
Apr 04, 2006
Walter Bright
April 03, 2006
The grammar for the lexical analysis contains:

EndOfFile:
physical end of the file
\u0000
\u001A

I don't understand, what's a \u001A? Substitution? How does that work? Wouldn't you want something like \u0019, end of medium?


April 03, 2006
In article <e0s3ct$1pk6$1@digitaldaemon.com>, Luís Marques says...
>
>The grammar for the lexical analysis contains:
>
>EndOfFile:
>physical end of the file
>\u0000
>\u001A
>
>I don't understand, what's a \u001A? Substitution? How does that work? Wouldn't you want something like \u0019, end of medium?
>
>

0x1A (or CTRL-Z or ASCII 26) is a holdover from CP/M, which Windows inherited
via DOS:

http://blogs.msdn.com/oldnewthing/archive/2004/03/16/90448.aspx

The 'copy' command that the article mentions works something like this:

c:\> copy con > foobar.txt

This will copy every keypress to the text file until you press CTRL-Z.  Its actually pretty handy if you're repairing a system with a paperclip, a battery and some duct-tape.

- EricAnderton at yahoo
April 03, 2006
In article <e0s5nm$1rpr$1@digitaldaemon.com>, pragma says...
>0x1A (or CTRL-Z or ASCII 26) is a holdover from CP/M, which Windows inherited
>via DOS:
>
>http://blogs.msdn.com/oldnewthing/archive/2004/03/16/90448.aspx
>
>The 'copy' command that the article mentions works something like this:
>
>c:\> copy con > foobar.txt
>
>This will copy every keypress to the text file until you press CTRL-Z.  Its actually pretty handy if you're repairing a system with a paperclip, a battery and some duct-tape.

That's very interesting. I use CTRL-Z in several console programs but I didn't
know programs read that
as \u001A nor from where that convention came.

I still don't really grok the relationship between CTRL-[X] codes and
ASCII/Unicode, on unix and
windows, but I guess that's another story.

Which also makes me wonder, if it wasn't a type afterall, what's the purpose of
characters like \u0019.
The sites listing Unicode characters don't generally have much semantic
information on them.

Luís
April 03, 2006
Luís Marques wrote:
> In article <e0s5nm$1rpr$1@digitaldaemon.com>, pragma says...
> 
>>0x1A (or CTRL-Z or ASCII 26) is a holdover from CP/M, which Windows inherited
>>via DOS:
>>
>>http://blogs.msdn.com/oldnewthing/archive/2004/03/16/90448.aspx
>>
>>The 'copy' command that the article mentions works something like this:
>>
>>c:\> copy con > foobar.txt
>>
>>This will copy every keypress to the text file until you press CTRL-Z.  Its
>>actually pretty handy if you're repairing a system with a paperclip, a battery
>>and some duct-tape.
> 
> 
> That's very interesting. I use CTRL-Z in several console programs but I didn't
> know programs read that as \u001A nor from where that convention came.
> 
> I still don't really grok the relationship between CTRL-[X] codes and
> ASCII/Unicode, on unix and windows, but I guess that's another story.
> 
> Which also makes me wonder, if it wasn't a type afterall, what's the purpose of
> characters like \u0019. The sites listing Unicode characters don't generally have much semantic
> information on them.
> 
> Luís


IIRC CTRL-[x] ends up, in ASCII, masking out a single bit from [x], I think it is the 64s place but I may be wrong.
April 03, 2006
On Mon, 03 Apr 2006 16:11:04 -0700, BCS <BCS_member@pathlink.com> wrote:
> Luís Marques wrote:
>> In article <e0s5nm$1rpr$1@digitaldaemon.com>, pragma says...
>>
>>> 0x1A (or CTRL-Z or ASCII 26) is a holdover from CP/M, which Windows inherited
>>> via DOS:
>>>
>>> http://blogs.msdn.com/oldnewthing/archive/2004/03/16/90448.aspx
>>>
>>> The 'copy' command that the article mentions works something like this:
>>>
>>> c:\> copy con > foobar.txt
>>>
>>> This will copy every keypress to the text file until you press CTRL-Z.  Its
>>> actually pretty handy if you're repairing a system with a paperclip, a battery
>>> and some duct-tape.
>>   That's very interesting. I use CTRL-Z in several console programs but I didn't
>> know programs read that as \u001A nor from where that convention came.
>>  I still don't really grok the relationship between CTRL-[X] codes and
>> ASCII/Unicode, on unix and windows, but I guess that's another story.
>>  Which also makes me wonder, if it wasn't a type afterall, what's the purpose of
>> characters like \u0019. The sites listing Unicode characters don't generally have much semantic
>> information on them.
>>  Luís
>
>
> IIRC CTRL-[x] ends up, in ASCII, masking out a single bit from [x], I think it is the 64s place but I may be wrong.

I think you're correct. If you look at an ASCII character table, find the @ character, you'll notice that following it in sequence are the capital A thru Z characters, then [ \ ] ^ _

CTRL+[X] where [X] is one of those characters results in the value of that character with the 64s place masked, eg.

@ == 0x40, CTRL+@ == 0x00
A == 0x41, CTRL+A == 0x01
..
Z == 0x5A, CTRL+Z == 0x1A
..
_ == 0x5F, CTRL+_ == 0x1F

Regan
April 04, 2006
Luís Marques wrote:
> The grammar for the lexical analysis contains:
> 
> EndOfFile:
> physical end of the file
> \u0000
> \u001A
> 
> I don't understand, what's a \u001A? Substitution? How does that work?
> Wouldn't you want something like \u0019, end of medium?

Some text editors mark the end of the text with a 0x1A (control Z) character. It's a holdover from the DOS days when files got padded out to the next sector boundary.