Changeset 110


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

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

Location:
Include/basic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/command.sbp

    r90 r110  
    149149    Dim i As Long ,i2 As Long, i3 As Long
    150150    Dim buffer As String
    151     Dim temp[1] As Byte
     151    Dim temp[1] As Char
    152152    Dim dwAccessBytes As DWord
    153153    Dim IsStr As Long
     
    251251Function _System_GetUsingFormat(UsingStr As String) As String
    252252    Dim i2 As Long, i3 As Long, i4 As Long, i5 As Long, ParmNum As Long
    253     Dim temporary[255] As Byte
     253    Dim temporary[255] As Char
    254254    Dim buffer As String
    255255
     
    271271        If UsingStr[i2]=Asc("#") Then
    272272            Dim dec As Long, sign As Long
    273             Dim temp2 As BytePtr
     273            Dim temp2 As *Char
    274274
    275275            Dim length_num As Long, length_buf As Long
  • 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
  • Include/basic/function.sbp

    r94 r110  
    344344'------------
    345345
    346 Function Asc(buf As String) As Byte
     346Function Asc(buf As String) As Char
    347347    Asc = buf[0]
    348348End Function
    349349
    350 Function Chr$(code As Byte) As String
     350Function Chr$(code As Char) As String
    351351    Chr$=ZeroString(1)
    352352    Chr$[0]=code
     
    497497End Function
    498498
    499 Dim _System_ecvt_buffer[16] As Byte
     499Dim _System_ecvt_buffer[16] As Char
    500500Sub _ecvt_support(count As Long)
    501501    Dim i As Long
     
    511511        End If
    512512    Else
    513         _System_ecvt_buffer[count]=_System_ecvt_buffer[count]+1 As Byte
     513        _System_ecvt_buffer[count]=_System_ecvt_buffer[count]+1 As Char
    514514    End If
    515515End Sub
     
    549549
    550550    For i=0 To count-1
    551         _System_ecvt_buffer[i]=Int(value) As Byte
     551        _System_ecvt_buffer[i]=Int(value) As Char
    552552
    553553        value=(value-CDbl(Int(value)))*10
     
    578578    End If
    579579    Dim dec As Long, sign As Long
    580     Dim buffer[32] As Byte, temp As BytePtr
     580    Dim buffer[32] As Char, temp As *Char
    581581    Dim i As Long, i2 As Long, i3 As Long
    582582
     
    664664End Function
    665665Function Str$(value As LONG_PTR) As String
    666     Dim temp[255] As Byte
     666    Dim temp[255] As Char
    667667    wsprintf(temp,"%d",value)
    668668    Str$=MakeStr(temp)
     
    739739                If Not (0<=i3 And i3<=7) Then Exit While
    740740
    741                 TempPtr[i]=i3 As Byte
     741                TempPtr[i]=i3 As Char
    742742                i++
    743743            Wend
     
    762762                End If
    763763
    764                 TempPtr[i]=i3 As Byte
     764                TempPtr[i]=i3 As Char
    765765                i++
    766766            Wend
     
    918918Sub _splitpath(path As BytePtr, drive As BytePtr, dir As BytePtr, fname As BytePtr, ext As BytePtr)
    919919    Dim i As Long, i2 As Long, i3 As Long, length As Long
    920     Dim buffer[MAX_PATH] As Byte
     920    Dim buffer[MAX_PATH] As Char
    921921
    922922    '":\"をチェック
     
    934934    i2=0
    935935    Do
     936#ifdef UNICODE
     937' ToDo: サロゲートペアの認識
     938#else
    936939        If IsDBCSLeadByte(path[i])=TRUE and path[i+1]<>0 Then
    937940            If dir Then
     
    944947            Continue
    945948        End If
     949#endif
    946950
    947951        If path[i]=0 Then Exit Do
  • Include/basic/prompt.sbp

    r90 r110  
    1616Dim _PromptSys_hFont As HFONT
    1717Dim _PromptSys_FontSize As SIZE
    18 Dim _PromptSys_InputStr[255] As Byte
     18Dim _PromptSys_InputStr[255] As Char
    1919Dim _PromptSys_InputLen As Long
    2020Dim _PromptSys_KeyChar As Byte
    2121Dim _PromptSys_CurPos As POINTAPI
    22 Dim _PromptSys_Buffer[100] As BytePtr
     22Dim _PromptSys_Buffer[100] As *Char
    2323Dim _PromptSys_TextColor[100] As DWordPtr
    2424Dim _PromptSys_BackColor[100] As DWordPtr
     
    5353    Dim hOldFont As HFONT
    5454    Dim sz As SIZE
    55     Dim temporary[2] As Byte
     55    Dim temporary[2] As Char
    5656
    5757    hOldFont=SelectObject(hDC,_PromptSys_hFont)
     
    258258                Else
    259259                    _PromptSys_InputStr[_PromptSys_InputLen]=wParam As Byte
    260                     _PromptSys_InputLen=_PromptSys_InputLen+1
     260                    _PromptSys_InputLen++
    261261
    262262                    temporary[0]=wParam As Byte
Note: See TracChangeset for help on using the changeset viewer.