Say, we had a function with all (or as much/many as possible) features and frills of WriteLn() but one that returned a string. Lets call it WriteLnAsString().
Well, there is. WriteStr()
You'll have to ask the Delphi gurus why this can't be done in Delphi.
Even if we could assemble some source code for you (which would do compiler magic), which we can't, it wouldn't be compatible with Delphi. It can't because it's too much up to the compiler (which is not open source in Delphi). And for FPC you've already have writestr().
Yet, WriteLn is blocking me --or, bothering me-- as the current proposals will only add further complexity to the code.
I have to say, I have come to hate WriteLn with an immesurable passion...
I have never used it. But the danm thing comes up in legacy code.
And that's why you need to REWRITE all those calls. No modern function exists with those exact possibilities. Using a function like it... You can just as well capture the standard output or use writestr. Capturing the standard output is the easiest and most invisible to the original code. (You don't need something like writeln(f,...). But if you are going to put every string in a different editbox, writestr would be your best bet.
Making it compatible with Delphi would.mean you need to ask there for a writestr or rewrite all the calls to modern commands.