Dewayne_Pinion
11 years agoContributor
Issue trying to compare date value in a while loop
Hello all,
This is making me pull my hair out, and I am sure it is something simple I am just missing. I have a datepicker control on a form that I am trying to evaluate with a while loop and have the loop stop when the datepicker equals a certain value:
while (RollDate.Text != "12/1/2014")
{
mModDRI();
fEdit();
RollDate = GetDatePicker("NativeClrObject.Name",dtpCurrentDate);
EnterDRIValues();
Rollover();
}This code fails to exit and the loop keeps continuing even after 12/1/2014 has been reached. If I try the same comparison in an if statement:
RollDate = GetDatePicker("NativeClrObject.Name",dtpCurrentDate);
if(RollDate["Text"] != "12/1/2014")
Log["Error"]("Date is incorrect","Date displayed is" + RollDate["Text"]);On 12/1/2014 the script execution passes and no error is posted to the log, as expected.
So what am I missing? :)