[Oberon] literal value for end of line character?

Chris Burrows chris at cfbsoftware.com
Sun Feb 4 01:52:15 MET 2007


> -----Original Message-----
> From: oberon-bounces at lists.inf.ethz.ch 
> [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Eric
> Sent: Sunday, 4 February 2007 10:59 AM
> To: oberon at lists.inf.ethz.ch
> Subject: [Oberon] literal value for end of line character?
> 
> 
> Hi all,
> 
> I wish to test a character to see if it is equal to the end-of line 
> character. (In Java this would be c == '\n'). How does one do this in 
> Oberon?  I tried
> 
> ch = DX
> 
> where D is the hexadecimal value for carriage return, but I got a 
> compiler error.
> 

That should be:

  IF ch = 0DX ....

with a leading zero to signify that it is a numeric value to distinguish
it from an identifier.

Note:

1. 0DX (13 decimal) is actually an ASCII CR (carriage return) character.
An ASCII LF (line-feed character) is 0AX (10 decimal). 

2. Conventionally on Unix systems end-of-line is just LF and on MS-DOS
heritage systems end-of-line is a CR-LF pair. 

3. I don't know about Java but in C, '\n' is an LF character.

Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp




More information about the Oberon mailing list