<div dir="ltr">The statement can be broken down as such:<div><br></div><div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:15px">(</span></div><div><span style="font-family:Calibri,sans-serif;font-size:15px"><font color="#1f497d">(D[now].dow != 1 && D[now].dow != 7) </font><span style="background-color:rgb(255,255,255)"><font color="#ff0000"> // if today is neither Saturday or Sunday</font></span></span></div>
<div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:15px">&& (T[now].getHours() > 7 && T[now].getHours() < 18)) </span><span style="font-family:Calibri,sans-serif;font-size:15px"><font color="#ff0000">// and the current time is between 7am and 6pm</font></span></div>
<div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:15px">|| (D[now].dow == 7 && (T[now].getHours() > 8 && T[now].getHours() < 12) </span><span style="font-family:Calibri,sans-serif;font-size:15px"><font color="#ff0000">// or, if today is saturday and the time is between 8am and noon</font></span></div>
<div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:15px">)</span><br></div><div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:15px"><br></span></div><div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px">That being said, it's terribly written and esoteric in the context given.</span></font></div>
<div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px"><br></span></font></div><div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px">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.</span></font></div>
<div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px"><br></span></font></div><div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px">Must have been a perl developer who wrote that line :)</span></font></div>
<div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px"><br></span></font></div><div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px">HTH</span></font></div><div><br>
</div><div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px">Regards,</span></font></div><div><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px">Tanner Ezell</span></font></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 8:08 AM, Matthew Collins <span dir="ltr"><<a href="mailto:mcollins@block.co.uk" target="_blank">mcollins@block.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="color:#1f497d">Hi All,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Anyone out there able to help me get my head around it?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">((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))<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Regards<u></u><u></u></span></p>
</div>
</div>
<br>_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><br>
<br></blockquote></div><br></div>