Bug in GetParaCol #bugs


joy8388608
 

It works ok when no text is selected, but different values are returned when text is selected by the user left to right vrs right to left.
I have not noticed this unexpected behavior in any of the other GetCol, GetColStart or related functions.

The way the text was selected should not matter or the documentation should say it is not valid when text is selected.

^$GetParaCol$
Returns cursor column position within paragraph in current document.

Joy


joy8388608
 

I spoke too quickly. GetParaCol actually makes sense this way because it more accurately reflects where the cursor really is . It is more the inconsistency with other similar functions such as GetCol which returns the same value when selecting from left to right or right to left that I'm warning about. Or maybe GetCol should be said to have a bug.

Joy


Axel Berger
 

"joy8388608 via Groups.Io" wrote:
I spoke too quickly. GetParaCol actually makes sense this way because
it more accurately reflects where the cursor really is.
Now you had me intrigued and I looked at it myself. Here's my test clip and
a sample output (the line-breaks after ^P are wrong and just for formatting
the post):

---------------------------------------------------------------
0A-Test
^!Info GetParaCol ^$GetParaCol$^P
GetCol ^$GetCol$^P
GetColStart ^$GetColStart$^P
GetColEnd ^$GetColEnd$
---------------------------------------------------------------
GetParaCol 151
GetCol 18
GetColStart 18
GetColEnd 41
---------------------------------------------------------------

What I see is:
All except ParaCol pertain to screen columns in the case of wrapped lines.
Only ParaCol uses what Regex sees as a "line" between ^ and $.

ParaCol is about the cursor as it should (and you say above) and ignores a
selection while ColStart and ColEnd are about the selection if there is
one.

Arguably GetCol is wrong. It ought to be about the cursor and not a synonym
for ColStart. But in those cases that use the selection not the cursor this
is clearly stated in the help file.

So I'd say, as you do now, that it works as designed and documented.


--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --