Changeset 606


Ignore:
Timestamp:
Aug 21, 2008, 10:21:19 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

Consoleにてエラー出力を整備

Location:
trunk/ab5.0/ablib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/Console.ab

    r526 r606  
    1010Class Console
    1111Public
     12    /*
     13    @brief 標準エラー出力を設定する
     14    @date 2008/08/21
     15    @auther Egtra
     16    */
     17    Static Sub SetError(newErr As IO.TextWriter)
     18        If ActiveBasic.IsNothing(newErr) Then
     19            Throw New ArgumentNullException("newErr")
     20        End If
     21        err = newErr
     22    End Sub
     23
     24    /*
     25    @brief 標準エラー出力を取得する
     26    @date 2008/08/21
     27    @auther Egtra
     28    */
     29    Static Function Error() As IO.TextWriter
     30        Error = err
     31    End Function
     32
    1233    /*
    1334    @brief 標準出力を設定する
     
    209230    Static in = Nothing As IO.TextReader
    210231    Static out = Nothing As IO.TextWriter
     232    Static err = Nothing As IO.TextWriter
    211233    Static cs = Nothing As ActiveBasic.Windows.CriticalSection
    212234End Class
  • trunk/ab5.0/ablib/src/basic/dos_console.sbp

    r593 r606  
    77
    88
     9Dim _System_hConsoleErr = GetStdHandle(STD_ERROR_HANDLE)
    910Dim _System_hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE)
    1011Dim _System_hConsoleIn = GetStdHandle(STD_INPUT_HANDLE)
     12System.Console.SetError(
     13     System.IO.TextWriter.Synchronized(New System.IO.StreamWriter(
     14        New System.IO.FileStream(_System_hConsoleErr, System.IO.FileAccess.Write, False))))
     15
    1116System.Console.SetOut(
    1217     System.IO.TextWriter.Synchronized(New System.IO.StreamWriter(
Note: See TracChangeset for help on using the changeset viewer.