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

Re: Further on Recording Keystrokes



≪	If you are recording strokes and you want to put in a carriage
return (ASCII 10 + ASCII 13), is there some simple way to do it? ≫ --N.
Sivin

Nathan: Actually, a carriage return is not (ASCII 10 + ASCII 13),
although this inaccuracy is common on the platform. A carriage return is
just an ascii 13 (the 8th note); ascii 10 is a linefeed. The programming
term for the compound ascii 13+ascii 10 is newline, often escaped as \n,
and I prefer it for its precision. In commercial printing, a carriage
return does what it says--returns the carriage to the beginning of the
line, a linefeed advances the paper or whatever (x amount of leading)
to the next line; the need to make more than one pass on the same line
is not uncommon. (PostScript adds that kind of control to xyWrite.)

The 8th note that keystroke recording generates when you hit 
becomes a newline when you run the macro if the cursor is in text. If the
cursor is on the CMline, the newline tries to execute whatever string is
already there. No, the 8th note doesn't look like a newline when you
study the macro but, after you run it, if you execute a search for a
newline you'll find that the char produced actually is one. Made all the
more confusing since the macro search char for a newline is an ascii 10.
... Ciao. 	--a

============================= adpFisher  nyc