programming.nbk: Home | Index | Next Page: Tcl: regexp ?switches? expression string ?matchvar submatchvar ...? | Previous Page: Tcl: procedures


 Tcl: puts

puts sends a string to the standard output. If the string has more than one word, you must delimit them with double-quotes or braces:

    puts "hello, world"
    puts {hello, world}

The full syntax is:

    <b>puts</b> ?<b>-nonewline</b>? ?channelId? string

The -nonewline switch prevents the normal newline character at the end of the output.

The channelId must be a identifier for an open channnel, such as the Tcl standard channels stdout and stderr, or the return value from [open] or [socket].

Output from puts is normally buffered. You can force the output to be displayed with [flush].


programming.nbk: Home | Index | Next Page: Tcl: regexp ?switches? expression string ?matchvar submatchvar ...? | Previous Page: Tcl: procedures


Notebook exported on Monday, 7 July 2008, 18:56:06 PM Eastern Daylight Time