Directly references a series without creating a copy in an SPL function.
A series, the source series to reference.
A series, a direct reference to the source series.
if (argc < 1)
// reference series in current Window
s = refseries(W0);
r = max(s) - min(s);
If the function srange is invoked without an input series, the input defaults to the series in the current Window. W0 refers to the current Window and the statement:
s = refseries(W0)
refers to the series in the current Window. In this case, the variable s is a direct reference to the series in the current Window and is assigned without first creating a copy. If the statement was:
s = W0;
then variable s would be assigned a copy of the series in W0.
As shown in the example, REFSERIES is very useful for defaulting the input to an SPL function to the series in the current Window. Because REFSERIES avoids copying the source series, SPL functions will execute faster for large series.
REFSERIES can be abbreviated as REFSER.
See REFWINDOW to reference and return a window.