www.delorie.com/gnu/docs/smalltalk/gst_87.html   search  
Buy GNU books!

GNU Smalltalk User's Guide

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.1 The Output Stream

The examples in this book all work because they write their output to the Transcript stream. Each class implements the printOn: method, and writes its output to the supplied stream. The printNl method all objects use is simply to send the current object a printOn: message whose argument is Transcript (by default attached to the standard output stream found in the stdout global). You can invoke the standard output stream directly:
   'Hello, world' printOn: stdout !
   stdout inspect !

or you can do the same for the Transcript, which is yet another stream:
   'Hello, world' printOn: stdout !
   Transcript inspect !

the last inspect statement will show you how the Transcript is linked to stdout(35).

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003