my video https://youtu.be/zx6WoApljBI
my story https://community.intersystems.com/post/45-years-intersystems-1978-2023
do ^ADMIN indicates that you run a classic straight ObjectScript program.
while WRITE just has 1 direction to act READ is bi-directional.
READ can send some text as prompt and waits for reply.
The only bi-directinal device I know of are network connections as TCP, UDP, TRM,FTP,..
The common feature is : they communicate out of your IRIS instance.
Inside IRIS you may do a redirection e.g to some TCP port like |TCP|7000
but then this port is blocked. No other process can touch |TCP|7000.
So you need an external port wrapper to some other port. e.g. |TCP|7100
Then you can handle this bi-directional communication either by sequence
or you have a list of prompts and the expected replies or similar.
The sequence of operation could then be:
- have a STARTER that runs in background
- initiate the external wrapper
- run do ^ADMIN
- start the FOREGROUND
- connect to external wrapper
- send prompts to terminal
- get replies from external file
- send it back to port
- which forwards it to ^ADMIN hanging in background
The most tricky point is to handle situations where the communication
if it is not just 1 Prompt :=> 1 Answer but
multiple Prompts or WRITEs :=>1 Answer or 1 Prompt :=> multiple Answers.
So I'd suggest instead of an IRIS internal solution rather look for an
external Terminal program to consume and apply your answer script.
check if your lines start with the labels or if you have some leading <blank> or <tab>
if so it is interpreted as function call instead of a label









Congratulations to the participants and winners.
Special BIG THANKS to the organizers and administrators of this contest. 💐🏵🌷🌻🌹
I'm really proud to see how this community has grown and raised in quality.