[cisco-voip] UCCX If conditional statement

Tanner Ezell tanner.ezell at gmail.com
Fri Jun 6 11:57:37 EDT 2014


The statement can be broken down as such:

(
(D[now].dow != 1 && D[now].dow != 7)  // if today is neither Saturday or
Sunday
&& (T[now].getHours() > 7 && T[now].getHours() < 18))  // and the current
time is between 7am and 6pm
|| (D[now].dow == 7 && (T[now].getHours() > 8 && T[now].getHours() < 12) //
or, if today is saturday and the time is between 8am and noon
)

That being said, it's terribly written and esoteric in the context given.

Assuming there is nothing more complex to the time control mechanism this
should be replaced with a Day of Week Step and Time of Day Step to enhance
readability.

Must have been a perl developer who wrote that line :)

HTH

Regards,
Tanner Ezell


On Fri, Jun 6, 2014 at 8:08 AM, Matthew Collins <mcollins at block.co.uk>
wrote:

>  Hi All,
>
>
>
> I’m working on a UCCX scrip at the moment and have come across an If
> conditional statement and I just can’t get my head around it. Think it’s
> just a time check and could replace with a time of day check but would like
> to understand it before I change anything.
>
>
>
> Anyone out there able to help me get my head around it?
>
>
>
> ((D[now].dow != 1 && D[now].dow != 7) && (T[now].getHours() > 7 &&
> T[now].getHours() < 18)) || (D[now].dow == 7 && (T[now].getHours() > 8 &&
> T[now].getHours() < 12))
>
>
>
>
>
> Regards
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20140606/d0c550ec/attachment.html>


More information about the cisco-voip mailing list