[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

R: Removing CR/LF in XyWrite



Replay to Olson Timothy and Russ W. Urquhart

Timothy,
I think something is wrong in your numerical conversion.

> But first, a bit of theory
>As I understand it, the ASCII character number for LF is 12 (or 0A in
hexadecimal);
> for CR it's 15 (or 0D).

A number can be differently represented changing the system of notation.
Thus, hexadecimal 0D equals decimal 13 (not 15), and hexadecimal 0A equals
decimal 10 (not 12); but they equal respectively octal 15 and octal 12, and
also binary 1101 and binary 1010. So probably you used the octal
representation while your mind was workking in decimal.

> Next I don't quite understand *why* they are this way

When the ASCII code was unambiguous (and as recently explained by someone
in this list) the "carriage return" (CR) character had the job to position
the typing head of the printer (or the cursor of the video-terminal) at the
very beginning of the (same) line, the "line feed" the job to position the
head on the next line, same column. And this was the way the printers (and
teletypes...) worked; still today the HP laser printers and the most part
of the impact printers have the option to apply to any single CR or LF the
native job or the combo job.

Russ,

> When i looked at the file in my hex
> editor, the 0A character became FF 30 41 ( i don't know what the FF is,
>but the 30 & 41 are the values for '0' and 'A', respectively.

Xy uses its own 3-bytes representation for some special characters; these 3
bytes are built this way:
- 1st byte: FF
- 2nd and 3th byte: the ASCII representation of the number representing the
character in hex notation.
In your example: FF + 30 + 41, i.e. FF + "0" + "A" (hex)

I'm conscious that this does not solve your problem, but I hope it clarify
something about the way xy works.

Ciao
Adriano Ortile