CoCoA:OpenOString

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Close

Introduction to IO

OpenIFile

OpenOFile

OpenIString

Source

Sprint

   <type>io</type>
   <type>printing</type>
   <type>string</type>