Last charactr of ^$Getline$
- Hello list,
I'm still using the version 6.2 light here at work. I've encountered a
strange behaviour of ^$Getline$, which is as follows:
Considering the four lines:
> L'When I try to get the ascii code of the last character, with:
for the second line, I get 13 instead of the ascii code of P.
After different tests, it seems that if the line has exactly three
characters, I get 13. If the line has two or just one character, I get
10, as for:
Is it the same with v 7?
There does seem to be a problem here.
All your examples work fine for me in NoteTab Pro 188.8.131.52 but not in NoteTab Light 184.108.40.206.
Using 8 lines of data
----I get54, 80, 45, 39, 45, 45, 45, 45 in Pro and54, 13, 13, 39, 10, 10, 13, 45 in Light.Note that character with Dec value 13 is a carriage return char (CR) and 10 is a Line Feed (LF) char. These chars are used to terminate lines and are normally not displayed. Different operating systems use just CR or just LF and many use CRLF which display as one character which can be confusing. My favorite way of knowing for sure is looking at the file with a hex editor. (Note 13 in hex is 'D' and 10 in hex is 'A'.)Joy
^!Prompt Line ^%L% Rightmost char -> ^$StrCopyRight(^$Getline$;1)$ ^%NL%Line ^%L% Rightmost char in decimal -> ^$CharToDec(^$StrCopyRight(^$Getline$;1)$)$
^!If ^%L% < ^$GetLineCount$ TOP