Jump to content

How is the following condition evaluated?


blartyo

Recommended Posts

Regarding the code below.

 

Does the On Mon, Tue, Wed, Thu, Fri really only apply to the From condition? Or, do the days specified apply to both the 'From' and 'To' conditions?

 

If
       On Mon, Tue, Wed, Thu, Fri
       From    12:00:00AM
       To      12:00:00AM (2 days later)

Then
  - No Actions - (To add one, press 'Action')

Else
  - No Actions - (To add one, press 'Action')

 

 

A) If the days specified refers to just the 'From' condition, then the Program Status would become false on Sunday at 12:00 AM.

 

B) If the days specified refers to both the 'From' and 'To' times, then the Program Status would become False on Saturday at 12:00 AM (since that is not Mon-Fri).

 

I think that version A) is how the logic works, but want to confirm. Maybe I'm too literal, but the program interface makes it look like version B) is how the logic is applied.

 

Hope that makes sense.

Link to comment

And is it correct that this would evaluate to False on Saturday at 12:00am

 

If
       On Mon, Tue, Wed, Thu, Fri
       From    12:00:00AM
       To      11:59:00PM 

Then
  - No Actions - (To add one, press 'Action')

Else
  - No Actions - (To add one, press 'Action')

Link to comment

GPG,

 

This will evaluate True at 12:00AM Mon/Tue/Wed/Thu/Fri Morning

This will evaluate False at 11:59:00PM on Mon/Tue/Wed/Thu/Fri

 

If 
       On Mon, Tue, Wed, Thu, Fri 
       From    12:00:00AM 
       To      11:59:00PM 

Then 
  - No Actions - (To add one, press 'Action') 

Else 
  - No Actions - (To add one, press 'Action') 

 

 

In this example, the program would be true from 9:30PM Friday until 2:00AM Saturday

If
       On Fri
       From     9:30:00PM
       To       2:00:00AM (next day)

Then
  - No Actions - (To add one, press 'Action')

Else
  - No Actions - (To add one, press 'Action')

Link to comment

Chris,

 

Thanks for the examples. I can see how an earlier TO time will get evaluated as of the next day. But...

 

I was fascinated by the original example with the FROM 12:00:00AM and TO 12:00:00AM. My brain is still arguing with me that the program should be false at say 12:01:00 AM Saturday instead of not until 12:00 AM Sunday as the original example indicates.

 

I know I am being a little thick about this, but I only see the Friday True interval as being: [FROM Friday 12:00:00am TO Saturday 12:00:00am]. What is the program evaluating at say 12:01 am Saturday such that the condition is still true?

 

Thanks,

George

Link to comment
Chris,

 

Thanks for the examples. I can see how an earlier TO time will get evaluated as of the next day. But...

 

Just to be clear, programs consider 12:00:00AM on Monday as 12:00:00AM that morning (i.e. Late Sunday night).

 

A truly earlier TO time will not get evaluted as the next day, instead it will never be true.

 

I was fascinated by the original example with the FROM 12:00:00AM and TO 12:00:00AM. My brain is still arguing with me that the program should be false at say 12:01:00 AM Saturday instead of not until 12:00 AM Sunday as the original example indicates.

Original example:
If 
       On Mon, Tue, Wed, Thu, Fri 
       From    12:00:00AM 
       To      12:00:00AM (2 days later) 

Then 
  - No Actions - (To add one, press 'Action') 

Else 
  - No Actions - (To add one, press 'Action') 

 

In the original example, the TO had the (2 days later) option, thus for a FROM on Friday the TO is really 12:00:00AM Sunday. If you change the TO to (same day) then it would have been false as 12:00:01 on Friday.

 

This actually brings up another point you should be aware of. If the next FROM time is earlier than the current TO time, then the program will cut short the current FROM/TO, and begin the next FROM/TO as scheduled, thus evaluating TRUE at the new FROM time.

 

This occurs in the original example. For example, on Thursday at 12:00:00AM, the schedule is still in the 2 day FROM/TO starting Wednesday, it now changes to a 2 day FROM/TO starting on Thursday.

 

 

I know I am being a little thick about this, but I only see the Friday True interval as being: [FROM Friday 12:00:00am TO Saturday 12:00:00am]. What is the program evaluating at say 12:01 am Saturday such that the condition is still true?

Again, depends on the (same day), (next day), (2 days later) etc. option specified.

Link to comment

Chris,

 

Thank you again for your explanation. I must apologize for not actually testing the from/to operation on the interface, before asking the question. If I had, I would have seen the same day/next day... options appear. This of course makes things a lot clearer. I have not used this particular program format before, but I can see some very good uses for it.

 

Thanks,

George.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...