A
StringWriter is a CSPro
logic object that supports building strings incrementally. Several write functions exist that add to the object's string buffer, either by writing text directly or by writing
encoded text. Using a StringWriter is simpler, and more efficient, than
concatenating many strings together.
A StringWriter is a CSPro logic object and the following functions can be called via
dot notation:
| Function | Description |
| clear | Clears the contents of the string buffer, resetting the buffer to a blank string. |
| toString | Returns the current contents of the string buffer. |
| write | Writes text to the string buffer without encoding. |
| writeEncoded | Writes text to the string buffer with encoding. |
| writeEncodedLine | Writes text and a newline to the string buffer with encoding. |
| writeLine | Writes text and a newline to the string buffer without encoding. |
| |
| getLabel | Returns the symbol's label. |
| getName | Returns the symbol's name. |
| getJson | Returns the symbol's metadata and value represented in JSON. |
| getValueJson | Returns the symbol's value represented in JSON. |
| setValueFromJson | Modifies the symbol based on a JSON representation of the value. |
StringWriter objects can be converted to and from
JSON strings.