My noobish understanding is that "if" statements are excuted if a boolean true occurs, and if it doesn't occur the script continues after the closing curly bracket.
The script below is from a numeric field and is fired by the calculate event, so it runs repeatedly. I'm wondering why the "hello world" part doesn't get excuted every time around. Instead, it always waits for a boolean true from the second "if".
if (ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location1.r awValue.length != 0 && ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location2.ra wValue.length != 0)
{
blah blah blah
}
if (ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location2.r awValue.length != 0 && ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location3.ra wValue.length != 0)
{
blah blah blah
}
xfa.host.messageBox("Hello World");
if (ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location3.r awValue.length != 0 && ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location4.ra wValue.length != 0)
{
blah blah blah
}
if (ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location4.r awValue.length != 0 && ExpenseClaim.Page2.DistanceRecord.TableKM.Row1.Locations.Location5.ra wValue.length != 0)
{
blah blah blah
}
And if I move the "hello world" part to below the third "if", it waits for that. What's going on here?
Thanks.