On 8/15/2005 6:51:55 PM, Walt Pattinson wrote:
>I wanted a different function of DEL_NEXT_WORD and DEL_PREV_WORD
>I created the following macros
Nice ones! Easier to understand than my version...
In DELPWORD.VDM you wrote
if (At_Eol) // If already at EOL reached, delete and stop
char(-1) // 2 chars
This way you are jumping between the CR and LF at EoL. And then you delete both bytes.
That may work in DOS-Format text files with CR/LF but will fail e.g. in UNIX-Format text files with only a LF.
You should try to use the value of "Newline_Chars" to determine the number of chars in a "newline" (See also in chapter "File Types").
And you should try to avoid jumping in between a CR/LF. It often leads to strange errors (tested by myself ;-)
Better work with if(At_BoL) a bit earlier here instead of first doing a char(-1) and then a if(At_EOL).