Write, Bureaucrats, Administrators
4,332
edits
mNo edit summary |
mNo edit summary |
||
Line 203: | Line 203: | ||
Suppose there is a library containing daily mileage of daily walks or use of a car or bicycle. Suppose the library has a StartingMileage field and a Mileage field. When an entry is created, the field StartMileage must get data from the field Mileage in the previous entry. | Suppose there is a library containing daily mileage of daily walks or use of a car or bicycle. Suppose the library has a StartingMileage field and a Mileage field. When an entry is created, the field StartMileage must get data from the field Mileage in the previous entry. | ||
<source lang="javascript" | <source lang="javascript"> | ||
var entries = lib().entries(); // Get the current library and an array of its entries | var entries = lib().entries(); // Get the current library and an array of its entries | ||
if (entries.length > 0) { // Check that the array is not empty; otherwise exit, | if (entries.length > 0) { // Check that the array is not empty; otherwise exit, |