Although a little late, the code for Word Wrapping was quite useful to me, and I am grateful to cazzajay and taazz. However, I noticed that under specific conditions, the line break generated a blank line while adjusting the column width. After analyzing the code and debugging, I discovered that the triggering condition occurred when the column edge coincided with a word followed by a space. Therefore, I recommend that in Unit1.pas, on line 91, "SetString(Line, S, E - S + 1)" be changed to:
begin
if E < S then
SetString(Line, S, P - S)
else
SetString(Line, S, E - S + 1);
end
I hope this will be useful to someone else. Greetings and thank you.