CoCoA:OpenOString
From ApCoCoAWiki
OpenOString
open output string
Description
This function opens strings for output. The string S
serves as the name of the device opened for input or output; one may
use the empty string. OpenOString is used to write to a string with the help of Print On.
Example
D := OpenOString(<quotes/>); -- open a string for output from CoCoA L := [1,2,3]; -- a list Print L On D; -- print to D D; Record[Name = <quotes/>, Type = <quotes>OString</quotes>, Protocol = <quotes>CoCoAL</quotes>] ------------------------------- S := Cast(D,STRING); -- S is the string output to D S; -- a string [1, 2, 3] ------------------------------- Print <quotes> more characters</quotes> On D; -- append to the existing output string Cast(D,STRING); [1, 2, 3] more characters -------------------------------
Syntax
OpenOString(S:STRING):DEVICE
<type>io</type> <type>printing</type> <type>string</type>