31 October 2021, 15:13 | #1 |
Registered User
Join Date: Apr 2019
Location: Heerlen / The Netherlands
Posts: 52
|
Monitor program so it's status can be a variable for script
Hi there. I've been busy lately to learn more about scripting to make my life as an Amigan/Vampirian easier and have lots of fun doing that along the way.
Currently I'm busy with something that would require me to startup a program via script using wbrun. This program is dependant on something else, which I startup earlier in the script. No what I want my script to do is monitor the status of the program I started using WBrun periodically. If it is still running the script waits and then LAB's back to monitor/check again, when the program is no longer running, the script continues and closes down whatever was started that the main program was dependant on. Is this possible to script? Preferably the arguments are generic, meaning that I always will know what name the proces will have to monitor. ie check status <name of program started / name of proces started by program) If running a program leads to dynamic assiging of attributes that could be monitored, I would like to see if it could be steered in a fairly fail proof manner. ie wbrun program as <controllablevariable> (here some proces number or other parameter would be used that is extremely unlikely to allready be in use. If this would also not be possible, I would like to see if a wild card manner of checking status is possible. This would lead to the logic : If a proces containing <unique identifier for started program> is running do this, else do that. I hope I have been able to bring across what I want in a understandable manner and look forward to finding out what is possible here and what not. Tnx in advance for any assistance. |
31 October 2021, 16:34 | #2 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,324
|
If I understand you right you want something like interprocess communication. As far as I know AmigaDOS has not something like this. With ARexx you could use message ports or maybe SETCLIP()/RXSET and GETCLIP().
|
31 October 2021, 18:02 | #3 |
Registered User
Join Date: Apr 2019
Location: Heerlen / The Netherlands
Posts: 52
|
Hi there. I think indeed you understand what I want. To put the mechanics into words I'll illustrate as follows.
Script : Startup whatever program need Startup program Label 1 Check program status If program is running Wait 1 Skip to label 1 Else Stop whatever program needed Endcli This is the working I'd like to achieve, if possible. If this can not be scripted, what would be the easiest to get my head around to program this. Arexx has the reputation of being fairly complex from what I've read about, maybe some simple basic programming could suffice? |
01 November 2021, 12:33 | #4 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,378
|
|
01 November 2021, 12:40 | #5 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,046
|
Yes, I would try
Code:
run >nil: needed_program program rx "address needed_program's_port quit" |
01 November 2021, 12:55 | #6 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,130
|
If you are not using ARexx, the 'status' command can help you
Code:
status COMMAND <command_name> You can assign the result to a variable and test it within your script. If the variable is empty, it means that your command ended. If you haven't seen it, please mind what I wrote here : https://eab.abime.net/showpost.php?p...6&postcount=20 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Make blitter shift value a variable? | Brick Nash | Coders. Asm / Hardware | 2 | 22 April 2021 14:31 |
Variable injection? | solarmon | support.WinUAE | 12 | 20 January 2019 12:05 |
Program to monitor joystick port | Brannigan | support.Apps | 4 | 29 June 2014 15:54 |
External windows program communicating with program running inside WinUAE | xxxxx | support.WinUAE | 10 | 19 February 2013 09:27 |
Variable Master Clock | wiltshireguyuk | request.UAE Wishlist | 0 | 13 December 2004 16:40 |
|
|