DADiSP Worksheet Functions > Function Categories > Data Type Conversion > CASTSERIES
Explicitly casts the input to a series.
CASTSERIES(val)
val |
- |
A scalar, series or table. |
A series.
castseries(8)
returns a one point series with the value 8. This is equivalent to: {8}
castseries(8 + 23i)
returns a series with one complex value: 8 + 23i. This is equivalent to:
{8 + 23i}
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}
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.