Ignore:
Timestamp:
Mar 9, 2007, 10:15:34 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

Environment, OperatingSystem, Versionの追加、Unicode対応修正ほか

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/dos_console.sbp

    r123 r142  
    2020    Dim i As Long, i2 As Long, i3 As Long
    2121    Dim buf As String
    22     Dim InputStr[1023] As Byte
     22    Dim InputBuf[1023] As TCHAR
    2323    Dim dwAccessBytes As DWord
    2424
     
    2828
    2929    '入力
    30     ReadConsole(_System_hConsoleIn, InputStr, Len(InputStr), dwAccessBytes, 0)
    31     If InputStr[dwAccessBytes-2] = &h0d And InputStr[dwAccessBytes-1] = &h0a Then
    32         InputStr[dwAccessBytes-2] = 0
     30    ReadConsole(_System_hConsoleIn, InputBuf, Len(InputBuf), dwAccessBytes, 0)
     31    If InputBuf[dwAccessBytes-2] = &h0d And InputBuf[dwAccessBytes-1] = &h0a Then
     32        InputBuf[dwAccessBytes-2] = 0
    3333    End If
     34    Dim InputStr As String(InputBuf)
    3435
    3536    'データを変数に格納
     
    5960        i++
    6061        If _System_InputDataPtr[i]=0 And InputStr[i2]=comma Then
    61             PRINT_ToPrompt("入力データの個数が多すぎます"+Chr$(10))
     62            PRINT_ToPrompt(Ex"入力データの個数が多すぎます\r\n")
    6263            Goto *InputReStart
    6364        ElseIf InputStr[i2]=0 Then
    6465            If _System_InputDataPtr[i]<>0 Then
    65                 PRINT_ToPrompt("入力データの個数が足りません"+Chr$(10))
     66                PRINT_ToPrompt(Ex"入力データの個数が足りません\r\n")
    6667                Goto *InputReStart
    6768            Else
     
    8081Sub PRINT_ToPrompt(buf As String)
    8182    Dim dwAccessBytes As DWord
     83#ifdef __STRING_UNICODE_WINDOWS_ANSI
     84'   Debug
     85    Dim oldAlloc = _System_AllocForConvertedString
     86    _System_AllocForConvertedString = AddressOf (_System_malloc)
     87    Dim pszOut As PCSTR
     88    Dim len = GetStr(buf, pszOut)
     89    _System_AllocForConvertedString = oldAlloc
     90    WriteConsole(_System_hConsoleOut, pszOut, len, dwAccessBytes, 0)
     91    _System_free(pszOut)
     92#else
    8293    WriteConsole(_System_hConsoleOut, buf.Chars, buf.Length, dwAccessBytes, 0)
     94#endif
    8395End Sub
    8496
Note: See TracChangeset for help on using the changeset viewer.