DADiSP Worksheet Functions > Function Categories > Data Type Conversion > CASTSTRING
Explicitly casts the input to a string.
CASTSTRING(val)
val |
- |
A scalar, series or table. |
A string.
caststring(8)
returns the string: 8
caststring(2+3i) + " hello"
returns the string: 2.0000 + 3.0000i hello
W1: gsin(100,.01)
caststring(max(W1))
returns the string: 1
W1: {68, 65, 68, 105, 83, 80}
caststring(W1)
returns the string: DADiSP
CASTSTRING is helpful when writing SPL functions that require an explicit string input and the type of the variable passed into the function may not be a string.
When used with integer input, CASTSTRING functions like STRCHARS.
When used with table input, CASTSTRING operates on the first column of the table.