Custom Pilot Currency Example: Flight as Examiner at Cape May Co. Airport in Last 12 Calendar Months

From ZuluLog Wiki
Jump to: navigation, search

In this example, we will create a custom currency definition that checks for at least one flight as an examiner at Cape May County Airport (KWWD) within the last twelve calendar months.


Creating the definition

1. Go to the Custom Pilot Currency Definition screen.
2. Under "Currency Name", enter a name for this currency, for example, "Examiner at KWWD - 12 cal months".
3. Under "Currency Period", enter 12 in the field and select "Calendar Months" from the drop-down.
4. Because we don't need to keep totals across different flights, leave the initialization script blank.
5. Enter the loop script as shown below:
var crew_role = getfieldstr("Crew Role");
var route = getfieldstr("Route");
 
if (strequal(crew_role, "Examiner") && 
    strindex(route, "KWWD") >= 0)  
  currency_ok = 1;


6. Enter a description for this currency if you wish, and then save it.
7. After saving the definition, you can check the status of your custom currency from the View Pilot Currency Detail screen.


How it works

We call getfieldstr() twice to get the Crew Role and Route field values as strings, and store them in the variables crew_role and route respectively. The names of these variables do not matter.

Next, we check to see whether the crew role value equals "Examiner" and whether the route value contains "KWWD" (the call to strindex() will return -1 if the search string is not found). If both of these are true, the currency is valid so we set currency_ok to 1.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox