up previous next
OpenOString

open output string

Syntax
OpenOString(): OSTREAM

Description
This function opens strings for output. OpenOString is used to write to a string with the help of print on . use close to obtain the string of characters "printed on" the ostream.

Example
/**/  str := OpenOString();  -- open a string for output from CoCoA
/**/  L := [1,2,3]; -- a list
/**/  print L on str;  -- print to str
/**/  str;

-------------------------------
/**/  close(str);  -- gives a string containing the output sent to str
[1, 2, 3]

See Also