Shell Interactive mode questions

Hi Xojo enthusiasts,

I have a few questions on the Interactive mode. I am running 2021r2.1

1- About the Interactive mode, documentation reads

The script can display a prompt …

What does mean can ? Does that mean it may sometimes display a prompt, and sometimes not ? Actually it does not, I use the DataAvailable event and display the output in an multiline TextArea, which is fine when commands are sent manually using a button.

2- Implementing an automatic mode

Things is I have to implement automatic mode that does not need to display the output. Is using the Interactive mode then the wrong way to go ? Capturing though is interesting in order to log the output in case something goes wrong.

Thanks

You’d use interactive mode when you want to send multiple commands and get responses for each. Use synchronous/asynchronous when you just want to execute a command and return. I think what the documentation means is that your application can display a prompt (your own UI) and then it can be sent to the shell with Write and responses received with DataAvailable.

If all you need to do is send a command and get a response, use async or sync; the main difference here is whether your app blocks (synchronous) waiting for a response (in the Result property) or continues on and you get responses as they come in through DataAvailable (note that, even in this mode, the complete response still goes in Result, so if all you need is the final output without blocking, use async mode and wait for the Completed event to fire, and then grab the output in Result).

Thanks for the information. I will use synchronous, since this will run when no one is watching the application. I will get the ExitCode: if it’s 0 then all is well, if not I know there was a problem and Result will tell me what is wrong. I will the log what’s wrong in SQLLite database.