Ignore:
Timestamp:
Feb 18, 2007, 11:19:00 PM (18 years ago)
Author:
イグトランス (egtra)
Message:

ByteからCharへの変更(不完全)ほか微修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/dos_console.sbp

    r1 r110  
    1010
    1111Dim _System_hConsoleOut As HANDLE, _System_hConsoleIn As HANDLE
    12 _System_hConsoleOut=GetStdHandle(STD_OUTPUT_HANDLE)
    13 _System_hConsoleIn=GetStdHandle(STD_INPUT_HANDLE)
     12_System_hConsoleOut = GetStdHandle(STD_OUTPUT_HANDLE)
     13_System_hConsoleIn = GetStdHandle(STD_INPUT_HANDLE)
    1414
    1515'---------- command.sbp内で定義済み ----------
     
    1818'---------------------------------------------
    1919Sub INPUT_FromPrompt(ShowStr As String)
    20     Dim i As Long ,i2 As Long, i3 As Long
     20    Dim i As Long, i2 As Long, i3 As Long
    2121    Dim buf As String
    2222    Dim InputStr[1023] As Byte
     
    2828
    2929    '入力
    30     ReadFile(_System_hConsoleIn,InputStr,1024,VarPtr(dwAccessBytes),ByVal 0)
    31     InputStr[dwAccessBytes-2]=0
     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
     33    End If
    3234
    3335    'データを変数に格納
     
    3537    i2=0
    3638    buf.ReSize(lstrlen(InputStr) + 1, 0)
    37     Dim comma As Byte
    38     comma = Asc(",")
     39    Dim comma As Char
     40    comma = &h2c 'Asc(",")
    3941    While 1
    4042        i3=0
     
    7375
    7476        i++
    75         If _System_InputDataPtr[i]=0 and InputStr[i2]=comma Then
     77        If _System_InputDataPtr[i]=0 And InputStr[i2]=comma Then
    7678            PRINT_ToPrompt("入力データの個数が多すぎます"+Chr$(10))
    7779            Goto *InputReStart
     
    9092
    9193Macro LOCATE(x As Long, y As Long)
    92     SetConsoleCursorPosition(_System_hConsoleOut, MAKELONG(x ,y))
     94    SetConsoleCursorPosition(_System_hConsoleOut, MAKELONG(x, y))
    9395End Macro
    9496
    9597Sub PRINT_ToPrompt(buf As String)
    9698    Dim dwAccessBytes As DWord
    97     WriteFile(_System_hConsoleOut, buf.Chars, buf.Length, VarPtr(dwAccessBytes), ByVal 0)
     99    WriteConsole(_System_hConsoleOut, buf.Chars, buf.Length, dwAccessBytes, 0)
    98100End Sub
    99101
Note: See TracChangeset for help on using the changeset viewer.