Changeset 132 for Include/basic


Ignore:
Timestamp:
Mar 4, 2007, 11:28:44 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

String型の自身を変更するメソッドを、戻り値で返すように変更。
併せて文字列比較を自前の関数で行うように変更。
プロンプトのキャレットの位置計算が正しくなかったバグを修正。

Location:
Include/basic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/function.sbp

    r126 r132  
    11371137End Function
    11381138
     1139Function _System_StrCmp(s1 As PCSTR, s2 As PCSTR) As Long
     1140    Dim i = 0 As SIZE_T
     1141    While s1[i] = s2[i]
     1142        If s1[i] = 0 Then
     1143            Exit While
     1144        End If
     1145        i++
     1146    Wend
     1147    _System_StrCmp = s1[i] - s2[i]
     1148End Function
     1149
     1150Function _System_StrCmp(s1 As PCWSTR, s2 As PCWSTR) As Long
     1151    Dim i = 0 As SIZE_T
     1152    While s1[i] = s2[i]
     1153        If s1[i] = 0 Then
     1154            Exit While
     1155        End If
     1156        i++
     1157    Wend
     1158    _System_StrCmp = s1[i] - s2[i]
     1159End Function
    11391160#endif '_INC_FUNCTION
  • Include/basic/prompt.sbp

    r127 r132  
    136136                .y++
    137137            Else
    138                 Dim currentLineCharInfo = _PromptSys_TextLine[.y].CharInfo As *_PromptSys_CharacterInformation
     138                Dim currentLineCharInfo = _PromptSys_TextLine[.y].CharInfo
    139139                _PromptSys_TextLine[.y].Text[.x] = buf[i2]
    140140                currentLineCharInfo[.x].ForeColor = _PromptSys_NowTextColor
     
    262262
    263263        CreateCaret(hwnd, 0, 9, 6)
    264         SetCaretPos(_PromptSys_CurPos.x * _PromptSys_FontSize.cx, (_PromptSys_CurPos.y + 1) * _PromptSys_FontSize.cy - 7)
     264        With _PromptSys_CurPos
     265            SetCaretPos(_PromptSys_TextLine[.y].CharInfo[.x].StartPos, (.y + 1) * _PromptSys_FontSize.cy - 7)
     266        End With
    265267        ShowCaret(hwnd)
    266268    End If
     
    353355
    354356        memcpy(VarPtr(_PromptSys_InputStr[_PromptSys_InputLen]), str, size)
    355         _PromptSys_InputLen += size
     357        _PromptSys_InputLen += size \ SizeOf (Char)
    356358
    357359        Dim tempStr As String(str, size \ SizeOf (Char))
Note: See TracChangeset for help on using the changeset viewer.