GetStandardStream Method

 

Description

 

Returns a TextStream object corresponding to the standard input, output, or error stream.

 

PowerBASIC Syntax

 

METHOD GetStandardStream ( _

BYVAL nStreamType AS LONG, _

OPTIONAL BYVAL bUnicode AS INTEGER _

) AS ITextStream

 

Arguments

 

nStreamType

LONG. Can be one of three constants: StdErr, StdIn, or StdOut.

bUnicode

Boolean value that indicates whether the file is created as a Unicode or ASCII file. The value is true if the file is created as a Unicode file, false if it is created as an ASCII file. If omitted, an ASCII file is assumed.

 

Settings

 

The nStreamType argument can have any of the following settings:

 

Constant

Value

Description

StdIn

0

Returns a TextStream object corresponding to the standard input stream.

StdOut

1

Returns a TextStream object corresponding to the standard output stream.

StdErr

2

Returns a TextStream object corresponding to the standard error stream.

 

Example [PowerBASIC]

 

#INCLUDE "windows.inc"

#INCLUDE "scrrun.inc"

 

DIM fso AS IFileSystem3

DIM pStm AS ITextStream

 

' Create an instance of the FileSystemObject

fso = NEWCOM "Scripting.FileSystemObject"

' Get the standard input stream

pStm = fso.GetStandardStream(%StreamType_StdIn, %FALSE)

 

Valid XHTML 1.0 Transitional