[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: XPL Code
- Subject: Re: XPL Code
- From: cld@xxxxxxxx (Carl Distefano)
- Date: Fri, 25 Mar 2005 20:59:16 -0500
Reply to note from "morris krok" Fri, 25 Mar
2005 07:27:20 +0200
> I am interested to know what XPL code will reveal whether the
> cursor position at the end of a line contains a carriaage
> return and the ascii code and symbol for it.
The carriage return is Ascii 13. However, what we DOS users
commonly refer to as a "carriage return" or "" or "CrLf"
actually consists of two Ascii characters, 13 and 10, a carriage
return followed by a line feed. Therefore, the carriage return
displayed in XyWrite and most other programs as a single character
is actually two bytes in length.
There must be a dozen ways in XPL to test for a CrLf at the end of a
line. Here is an easy one. The procedure is to DeFine the current
line (func DL), then SEarch within the DeFined text (SE/S) -- i.e.,
within the current line -- for a carriage return. If it's found,
the line ends in a CrLf. Here's the code:
XPLeNCODE v2.0
b-gin [UNTITLED]
[YD_][DL_][BX_]se/s [wC][Q2_]{<}IF{<}ER{>}{>}{<}PRNope{>}{<}
EX{>}{<}EI{>}{<}PRYep{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE
--
Carl Distefano
cld@xxxxxxxx