Delete last blank line in memo

I searched google but didn't seem to find a working solution.

the situation is unique. I need to “add” comment lines at different times. whenever I press the F9 key, a line number will be displayed, followed by a colon “:” char, and then I enter some comments on the line number and cursor position.

The working output should look like this:

001: startup time 002: watched tv 003: | 

where "|" is the last cursor position at runtime, waiting for some text to be entered.

but instead, when I run the program and press the F9 key, I get the following:

 001: 002: 003: | 

where "|" is the last cursor position at runtime, waiting for some text to be entered.

How to delete this (last) empty line in a note?

+4
source share
1 answer

Add() inserts a line break after the inserted text. If you don't want a line break, use the SelText property SelText , for example:

 Memo1.SelStart := Memo1.GetTextLen; Memo1.SelLength := 0; Memo1.SelText := '003: '; 
+15
source

All Articles