delta() is equivalent to primary(x)-secondary(s), as the second reading
is the first record of the pair. PIPELINE NEWS has this inverted.
The subject build-in functions imply SELECT items as follows:
primary() does SELECT 0 under the covers.
secondary() does SELECT SECOND under the covers.
As a result, delta() selects both reading stations under the covers.
Thus, if you write:
| spec select second qualify rec
if eof() then noprint else print delta(time)/4096000 1
endif
You might think that you should not see a run-in cycle, but the
implied SELECTS cause this to happen. The SPEC above is equivalent
to this (assuming the field is 1-4 and binary):
| spec qualify rec temp1: 1.4 . select second temp2: 1.4 .
if eof() then noprint
else print (c2d(temp1)-c2d(temp2))/4096000 1
endif
Where temp1 and temp2 are SPEC-assigned field identifiers.
j.