//apl_exec_cb('⍞←rs1', s); // not captured in s ??
apl_exec_cb('⍞←⍕rs1', s); // hot captured in s ??
Those are using an immediate input request. For that you need to use/install a callback with install_get_line_from_user_cb.
I've added functionality for that to reply #17 on jan 17th, see also example apl_test2b.pas
You are on your own with regards to the different input modes as I have no clue how the different modes should behave (I simply lack the time to investigate as documentation for apl for/on certain topics is very scarce).
the ⍕ character is the Monadic format ⍕B A character representation of B U+2355 ⍕
the callbacl method takes 96msec for a 30000 integer -> 89999 byte string test result (my largest current use exanple/need) vs 26msec when writing the result to a file with apl and then reading it back into an tstringlist
Can't comment on that a.t.m. other then If you need a different storing method for the result (f.e. stringlist) then you can create your own callback wrapper function.
I have no idea w.r.t. the time(penalty). You should be looking at direct library function calls, see also below.
⎕pw ⍕ problem
Are you referring to the plot window functionality ? (e.g. apl is non-case sensitive so that pw = PW ?)
this is not inlcuding the time that would be need to be taked to get rid of the #10 added
Although there is little documentation w.r.t. behaviour on certain functionality /this/ is at least a topic that is present in the docs

Have a look at CR. It is advised to use that in combination with certain function(s)/(ality)
There is an example in the official documentation that removes them i.c.w. XML.
because of the 3x time increase i renamed your apl_exec call back function apl_exec(example, s) to apl_exec_cb(example. s) and 'added' back in the original apl_exec for apl use and only use the apl_exec_cb callback for actualy capture of apl_exec output wnen needed.
In that regards you can do whatever you please

It is encouraged to write your own additions/correction. Only then things can improve
Just keep in mind that when you run into problems that you post the complete implementation that you used because how you implement things can influence behaviour (which we cannot replicate without using the same implementation).
I've named it the way I did for convenience because it is an overloaded function, which keeps things easy for the end-user.
Also note that I set and remove the callback for each call to apl_exec because you can install a different callback based on what functionality you require (and that can depend on which function you are actually executing).
So if you need other functionality then go ahead and add it to your own custom callback routine and name it whatever floats you boat

also of major importance is that your apl_exec_cb code does not negatively impact using it with )copy command
You should have a better/closer look at the other functionality that the apl library exposes.
I simply lack the time to delve deeper into things but am able to tell you that you can call functions directly as well as access values using direct calls to functions.
I'm a bit stuck with regards to the loc parameter stuff. Seems highly undocumented so would need to delve into their source-code to see how that should be used correctly.
Also I am unsure about how custom functions affect the different workbook environments when using direct library calls.
If you are interested in apl then you should experiment with those as well. I have added them in my local copy of ulibapl.
My knowledge about the apl language/library is pretty limited so am more often not able to tell if the experienced behaviour is as expected.
regards,