up previous next
print on

print to an output device

Syntax
print  E: OBJECT  on  D: DEVICE

Description
This command prints the value of expression E to the device D. Currently, the command can be used to print to files, strings, or the CoCoA window. In the first two cases, the appropriate device must be opened with OpenOFile or OpenOString .

Example
/**/  D := OpenOFile("my-test");  -- open "my-test" for output from CoCoA
/**/  Print "hello world" On D;   -- print string into "mytest"
/**/  close(D);  -- close the file
See OpenOFile for an example using output strings. For printing to the CoCoA window, just use print E which is short for print E On DEV.OUT .
See Also