Jump to content

Folder Conditions


Algorithm

Recommended Posts

Posted

Given a folder that has conditions which are presently True, and that some (or all) of the programs within that folder are running, what happens when the folder conditions become False? Do the running programs immediately stop? Or do they run to conclusion?

Posted

The programs continue to run, although this may not be the best semantics.

 

You can stop the programs explicitly, as in the following example. Make sure 'Program A' is not in the Folder, and that 'Program 1' and 'Program 2' are in the folder.

 

Program A:
IF 
   Condition 1 
THEN
  - 
Else 
   Stop Program 1
   Stop Program 2

Folder: 
IF 
   Program A is True 
THEN 
   Allow the programs in this folder to run.

Program 1: 
IF 
   Condition 2 
THEN 
   Action 1 
ELSE 
   Action 2 
ENDIF 

Program 3: 
IF 
   Condition 3 
THEN 
   Action 3 
ELSE 
   Action 4 
ENDIF

Posted
The programs continue to run, although this may not be the best semantics.

 

You can stop the programs explicitly, as in the following example.

 

Thank you! So the conditions on a folder determine when programs within it may begin running, but once started the programs will continue even when the folder conditions become False? And of course the running programs may be explicitly stopped.

 

That's just the way it should be, in my opinion. I wouldn't want all the running programs to terminate in the middle when the folder conditions became False.

 

However, does that not put folder conditions at variance with program conditions; i.e. doesn't a running program terminate immediately (even in the middle of its actions) when its conditions become False?

Posted

However, does that not put folder conditions at variance with program conditions; i.e. doesn't a running program terminate immediately (even in the middle of its actions) when its conditions become False?

 

Its definitely a topic to think about for Triggers 2.0.

 

When program conditions change for a running program it immediately stops, and then runs either the Then or Else. In this case, there isn't much choice but to to stop immediately otherwise you could have both the Then and Else running simultaneously.

Posted

However, does that not put folder conditions at variance with program conditions; i.e. doesn't a running program terminate immediately (even in the middle of its actions) when its conditions become False?

 

Its definitely a topic to think about for Triggers 2.0.

 

When program conditions change for a running program it immediately stops, and then runs either the Then or Else. In this case, there isn't much choice but to to stop immediately otherwise you could have both the Then and Else running simultaneously.

 

Yes, I agree. I shan't propose any changes just now, as I can't think of anything better at the moment. Perhaps others will have some thoughts on this.

 

But I've learned something new from your answer. If a program is running the Then (meaning either that its conditions are True, or that the Then path was invoked by another program), and while doing so the program's conditions become False, it doesn't just stop running the Then, but it also runs the Else. And further, if a program is running the Else (meaning either that it's conditions must be False, or that the Else path was invoked by another program), and while doing so the program's conditions become True, then it will immediately stop running the Else and start running the Then!

 

One more question regarding folder conditions: when a folder's conditions are False, can the programs within it still be run by other programs?

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...