ZuluScript: Advanced Currency Example 2 Example: 5 Hours in 15 Days, or 11 Hours in 30 Days, in H60
var hrs15 = 0, hrs30 = 0;
var icao = getfieldstr("ICAO Code");
if (strequal(icao, "H60"))
{
var ft = getfieldnum("Day Flight Time") +
getfieldnum("Night Flight Time");
hrs30 = hrs30 + ft;
if (getdaysago() <= 15)
hrs15 = hrs15 + ft;
if (hrs30 >= 11 || hrs15 >= 5)
currency_ok = 1;
}
hrs30. (We'll define the period for this currency
definition as 30 days, so we know all records we see are within 30 days.)
getdaysago() returns 15 or less, we know the record is
within the last 15 days, so we also add the flight time to hrs15.
hrs30, or 5 hours in hrs15. If either of these is
true, our currency is valid.