Write, Bureaucrats, Administrators
4,332
edits
mNo edit summary |
mNo edit summary |
||
Line 210: | Line 210: | ||
// since there is no previous entry. | // since there is no previous entry. | ||
prevMileage = entries[0].field("Mileage"); // The array is sorted from newest to oldest, | prevMileage = entries[0].field("Mileage"); // The array is sorted from newest to oldest, | ||
// so the newest entry already in the array will be on top with index of 0. | // so the newest entry already in the array | ||
entryDefault().set("StartMileage" , prevMileage ) // Set the value of the field Mileage from the previous entry as the default value for the field StartMileage. | // will be on top with index of 0. | ||
entryDefault().set("StartMileage" , prevMileage ) // Set the value of the field Mileage from the previous entry | |||
// as the default value for the field StartMileage. | |||
} | } | ||
</source> | </source> |