Previous Thread
Next Thread
Print Thread
aborting ctl task manager files #23831 04 Oct 18 02:43 PM
Joined: Jun 2001
Posts: 430
V
Valli Information Systems Online Content OP
Member
OP Online Content
Member
V
Joined: Jun 2001
Posts: 430
i have lots of ctl files that execute the same programs
run a
run b
run c
run d
logoff
i need a way that if something happens in one of the programs say a file is missing in program a that i can abort/exit the ctl / task manager at that point with out finishing the rest of the programs. what is / if any the best way to do this without redoing each of these scrips/ctl's. thanks

Re: aborting ctl task manager files #23832 05 Oct 18 03:35 AM
Joined: Jun 2001
Posts: 11,938
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,938
It's a very good question and I'm sorry to say I don't have a good answer. For whatever reason, we never adopted the concept of programs passing a termination code back to the environment, which could then be detected with IF.LIT.

I guess maybe the reason was that at least in the case of application programs (as opposed to simple LIT commands), it's not clear what the termination code would be, unless explicitly set by each program. (Other than the case of an untrapped BASIC error.)

Perhaps it wouldn't be that difficult to implement a new $ variable recognized by IF.LIT that was automatically set by each LIT or RUN at the end of each program to 0 for a normal termination, ### for an untrapped error, and anything explicitly set by some new MX_SET_EXIT_STATUS function.

But that would still involve inserting a lot of IF statements into each of your CTL files.

Perhaps a further simplification of that concept would be to have a single command at the top of the CTL that requested termination if the exit status of any program becomes non-zero.

But all of those involve modifications to A-Shell, updates, etc.

As for what you can do right now, one idea would be to terminate the A-Shell session using MX_EXIT . (You'd have to add that logic to each of the constituent programs.)

Re: aborting ctl task manager files #23833 07 Oct 18 01:37 AM
Joined: Jun 2001
Posts: 430
V
Valli Information Systems Online Content OP
Member
OP Online Content
Member
V
Joined: Jun 2001
Posts: 430
thanks, the mx_exit added to just two programs and works like a charm


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3