CASTSERIES

Purpose:

Explicitly casts the input to a series.

Syntax:

CASTSERIES(val)

val

-

A scalar, series or table.

Returns:

A series.

Example:

castseries(8)

 

returns a one point series with the value 8. This is equivalent to: {8}

Example:

castseries(8 + 23i)

 

returns a series with one complex value: 8 + 23i. This is equivalent to:

{8 + 23i}

Example:

castseries("string")

 

Equivalent to {"string"} and returns a series with the ASCII codes for the characters in the string "string": {115,116,114,105,110,103}

 

castseries("DADiSP")

 

returns a series with the ASCII codes for the characters in the string "DADiSP": {68,65,68,105,83,80}

Remarks:

CASTSERIES is helpful when writing SPL functions that require an explicit series input and the type of the variable passed into the function may not be a series.

 

The {} also cast the input into a series.

 

The SERIES modifier forces an SPL function to return a series result.

 

The ITERATE modifier causes an SPL function to automatically apply the calculation to each column of an array.

 

When used with string input, CASTSERIES functions like CHARSTRS.

See Also:

{} Array Construction

CASTCOMPLEX

CASTINTEGER

CASTREAL

CASTSTRING

CASTWINDOW

CHARSTRS

GSERIES

ITERATE

SERIES