instead of executing an external program i want to get the writeln to go into the aprocess.output
1. You execute an external program using tprocess in order to access aprocess.output. Without the former there is no latter.
2. You explicitely mention that you wish to writeln to aprocess.out which does not make any sense to me because aprocess.output is a pipe (say buffer) that /retrieves/ all output from aprocess (in layman terms: if you have program x is executed by tprocess and that uses writeln's then the writeln's of program/process x (which normally end up in the terminal) will be written (because output is redirected) to aprocess.output.
Ofc. you can add your own strings/writeln's to that /retrieved/ output from program/process x but it is useless other then that you have adjusted the output from program/process x.
Did you perhaps meant that you wish to tell something to program/process x so that program/process x receives your writeln's as if you would have typed it with the keyboard in a terminal window ?
If so, then for that you would have to write to the input pipe of the process (it can perhaps be confusing but the output of your program is the input for process/program x, and vice verse).
If indeed the case then the following link contains an example of such method:
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/examples/process/I have no idea if Thaddy showed you something similar but if he did then you can ofc. use his code as example as well.
Apologies in case this post comes across as being written by a 2 year old but I simply fail to find a better method to explain.