Changeset 90


Ignore:
Timestamp:
Feb 12, 2007, 12:14:04 AM (17 years ago)
Author:
イグトランス (egtra)
Message:

インクリメント・デクリメントなどの活用

Location:
Include/basic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/command.sbp

    r89 r90  
    105105'--------------
    106106
    107 Dim _System_hFile(255) As VoidPtr
     107Dim _System_hFile(255) As HANDLE
    108108Macro OPEN(lpFileName As String, AccessFor As Long, FileNumber As Long)
    109109    Dim dwAccess As Long
    110     Dim bAppend As Long
     110    Dim bAppend = 0 As Long
    111111    Dim dwCreationDisposition As Long
    112112
    113     FileNumber=FileNumber-1
    114 
    115     bAppend=0
     113    FileNumber--
     114
    116115    Select Case AccessFor
    117116        Case 0
     
    134133    If bAppend Then SetFilePointer(_System_hFile(FileNumber),0,NULL,FILE_END)
    135134End Macro
     135
    136136Macro CLOSE()(FileNumber As Long)
    137     FileNumber=FileNumber-1
     137    FileNumber--
    138138
    139139    If _System_hFile(FileNumber) Then
     
    153153    Dim IsStr As Long
    154154
    155     FileNumber=FileNumber-1
     155    FileNumber--
    156156
    157157    buffer=ZeroString(GetFileSize(_System_hFile[FileNumber],0))
     
    173173        IsStr=0
    174174        While 1
    175             i3=i3+1
     175            i3++
    176176
    177177            i2=ReadFile(_System_hFile[FileNumber],temp,1,VarPtr(dwAccessBytes),ByVal 0)
     
    263263            buffer[i3]=UsingStr[i2]
    264264            If UsingStr[i2]=0 Then Exit While
    265             i2=i2+1
    266             i3=i3+1
     265            i2++
     266            i3++
    267267        Wend
    268268
     
    283283            i4=i2
    284284            While UsingStr[i4]=Asc("#")
    285                 i4=i4+1
     285                i4++
    286286            Wend
    287287            If UsingStr[i4]=Asc(".") Then
    288                 i4=i4+1
     288                i4++
    289289
    290290                dblRoundOff=0.5
    291291                While UsingStr[i4]=Asc("#")
    292                     i4=i4+1
    293                     dblRoundOff=dblRoundOff/10
     292                    i4++
     293                    dblRoundOff /= 10
    294294                Wend
    295295            End If
     
    304304
    305305            '符号が有る場合は、一文字分のスペースを考慮する
    306             If sign Then length_num=length_num+1
     306            If sign Then length_num++
    307307
    308308            length_buf=0
    309309            Do
    310                 i2=i2+1
    311                 length_buf=length_buf+1
     310                i2++
     311                length_buf++
    312312            Loop While UsingStr[i2]=Asc("#")
    313313
     
    315315                '通常時
    316316                FillMemory(StrPtr(buffer)+i3,length_buf-length_num,Asc(" "))
    317                 i3=i3+(length_buf-length_num)
     317                i3 += length_buf - length_num
    318318
    319319                If sign Then
    320320                    buffer[i3]=Asc("-")
    321                     i3=i3+1
    322 
    323                     length_num=length_num-1
     321                    i3++
     322
     323                    length_num--
    324324                End If
    325325
     
    330330                End If
    331331
    332                 i3=i3+length_num
     332                i3 += length_num
    333333            Else
    334334                '表示桁が足りないとき
    335335                FillMemory(StrPtr(buffer)+i3,length_buf,Asc("#"))
    336                 i3=i3+length_buf
     336                i3 += length_buf
    337337            End If
    338338
    339339            If UsingStr[i2]=Asc(".") Then
    340340                buffer[i3]=UsingStr[i2]
    341                 i2=i2+1
    342                 i3=i3+1
     341                i2++
     342                i3++
    343343
    344344                i4=dec
     
    349349                        buffer[i3]=temp2[i4]
    350350                    End If
    351                     i3=i3+1
    352                     i4=i4+1
    353 
    354                     i2=i2+1
     351                    i3++
     352                    i4++
     353
     354                    i2++
    355355                Wend
    356356            End If
    357357        ElseIf UsingStr[i2]=Asc("@") Then
    358             i2=i2+1
     358            i2++
    359359
    360360            lstrcat(StrPtr(buffer)+i3,_System_UsingStrData[ParmNum])
     
    363363            i4=0
    364364            Do
    365                 i4=i4+1
    366                 i2=i2+1
     365                i4++
     366                i2++
    367367            Loop While UsingStr[i2]=Asc(" ")
    368368
    369369            If UsingStr[i2]=Asc("&") Then
    370                 i4=i4+1
    371                 i2=i2+1
     370                i4++
     371                i2++
    372372                i5=lstrlen(_System_UsingStrData[ParmNum])
    373373                If i4<=i5 Then
     
    377377                End If
    378378                memcpy(StrPtr(buffer)+i3,_System_UsingStrData[ParmNum],i5)
    379                 i3=i3+i4
     379                i3 += i4
    380380            Else
    381                 i2=i2-i4
     381                i2 -= i4
    382382                buffer[i3]=Asc("&")
    383                 i2=i2+1
    384                 i3=i3+1
     383                i2++
     384                i3++
    385385                Continue
    386386            End If
    387387        End If
    388388
    389         ParmNum=ParmNum+1
     389        ParmNum++
    390390    Wend
    391391
     
    396396    Dim buf As String
    397397
    398     FileNumber=FileNumber-1
     398    FileNumber--
    399399    buf=_System_GetUsingFormat(UsingStr)
    400400
     
    404404Dim _System_FieldSize(255) As Long
    405405Macro FIELD(FileNumber As Long, FieldSize As Long)
    406     FileNumber=FileNumber-1
     406    FileNumber--
    407407
    408408    _System_FieldSize(FileNumber)=FieldSize
     
    411411    Dim dwAccessByte As Long
    412412
    413     FileNumber=FileNumber-1
    414     RecodeNumber=RecodeNumber-1
     413    FileNumber--
     414    RecodeNumber--
    415415
    416416    SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN)
     
    424424    Dim dwAccessByte As Long
    425425
    426     FileNumber=FileNumber-1
    427     RecodeNumber=RecodeNumber-1
     426    FileNumber--
     427    RecodeNumber--
    428428
    429429    SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN)
     
    435435End Macro
    436436Macro MKDIR(path As String)
    437     CreateDirectory(path, ByVal 0)
     437    CreateDirectory(path, 0)
    438438End Macro
    439439Macro KILL(path As String)
  • Include/basic/prompt.sbp

    r89 r90  
    1010Dim _PromptSys_hWnd As HWND
    1111Dim _PromptSys_dwThreadID As DWord
    12 Dim _PromptSys_bInitFinish As Long
     12Dim _PromptSys_bInitFinish As BOOL
    1313
    1414'text
     
    7373        _PromptSys_BackColor[100]=HeapAlloc(_System_hProcessHeap,HEAP_ZERO_MEMORY,255*SizeOf(LONG_PTR))
    7474
    75         _PromptSys_CurPos.y=_PromptSys_CurPos.y-1
     75        _PromptSys_CurPos.y--
    7676
    7777        'Redraw
     
    108108                    temporary,lstrlen(temporary))
    109109
    110                 If IsDBCSLeadByte(temporary[0]) Then i2=i2+1
     110                If IsDBCSLeadByte(temporary[0]) Then i2++
    111111            Next
    112112        End If
    113113
    114         i=i+1
     114        i++
    115115    Wend
    116116
     
    135135                FillMemory(_PromptSys_Buffer[_PromptSys_CurPos.y]+_PromptSys_CurPos.x,i3,Asc(" "))
    136136
    137                 i2=i2+1
    138                 _PromptSys_CurPos.x=_PromptSys_CurPos.x+i3
     137                i2++
     138                _PromptSys_CurPos.x += i3
    139139                Continue
    140140            End If
    141141
    142142            If buf[i2]=13 and buf[i2+1]=10 Then '\r\n
    143                 i2=i2+2
    144                 _PromptSys_CurPos.y=_PromptSys_CurPos.y+1
     143                i2 += 2
     144                _PromptSys_CurPos.y++
    145145                _PromptSys_CurPos.x=0
    146146                Continue
     
    152152            _PromptSys_BackColor[_PromptSys_CurPos.y][_PromptSys_CurPos.x]=_PromptSys_NowBackColor
    153153
    154             i2=i2+1
    155             _PromptSys_CurPos.x=_PromptSys_CurPos.x+1
     154            i2++
     155            _PromptSys_CurPos.x++
    156156        Loop
    157157
     
    440440            If _PromptSys_InputStr[i2]=0 Then Exit While
    441441
    442             i2=i2+1
    443             i3=i3+1
     442            i2++
     443            i3++
    444444        Wend
    445445
     
    466466        End Select
    467467
    468         i=i+1
     468        i++
    469469        If _System_InputDataPtr[i]=0 and _PromptSys_InputStr[i2]=Asc(",") Then
    470470            PRINT_ToPrompt(Ex"入力データの個数が多すぎます\r\n")
     
    499499    i=0
    500500    While _PromptSys_Buffer[y][i]
    501         i=i+1
     501        i++
    502502    Wend
    503503
     
    550550        Ellipse(_PromptSys_hMemDC,x-radius,y-radi2,x+radius,y+radi2)
    551551    Else
    552         StartPos=StartPos*100
    553         EndPos=EndPos*100
     552        StartPos *=StartPos
     553        EndPos *=EndPos
    554554
    555555        If StartPos<0 Or EndPos<0 Then
     
    559559        End If
    560560
    561         If StartPos<0 Then StartPos=StartPos*-1
    562         If EndPos<0 Then EndPos=EndPos*-1
     561        StartPos = Abs(StartPos)
     562        EndPos = Abs(EndPos)
    563563
    564564        If StartPos<=78.5 Then
     
    566566            i2=Int(StartPos)
    567567        ElseIf StartPos<=235.5 Then
    568             StartPos=StartPos-78.5
     568            StartPos -= 78.5
    569569            i1=78-Int(StartPos)
    570570            i2=78
    571571        ElseIf StartPos<=392.5 Then
    572             StartPos=StartPos-235.5
     572            StartPos -= 235.5
    573573            i1=-78
    574574            i2=78-Int(StartPos)
    575575        ElseIf StartPos<=549.5 Then
    576             StartPos=StartPos-392.5
     576            StartPos -= 392.5
    577577            i1=-78+Int(StartPos)
    578578            i2=-78
    579579        ElseIf StartPos<=628 Then
    580             StartPos=StartPos-549.5
     580            StartPos -= 549.5
    581581            i1=78
    582582            i2=-78+Int(StartPos)
     
    587587            i4=Int(EndPos)
    588588        ElseIf EndPos<=235.5 Then
    589             EndPos=EndPos-78.5
     589            EndPos -= 78.5
    590590            i3=78-Int(EndPos)
    591591            i4=78
    592592        ElseIf EndPos<=392.5 Then
    593             EndPos=EndPos-235.5
     593            EndPos -= 235.5
    594594            i3=-78
    595595            i4=78-Int(EndPos)
    596596        ElseIf EndPos<=549.5 Then
    597             EndPos=EndPos-392.5
     597            EndPos -= 392.5
    598598            i3=-78+Int(EndPos)
    599599            i4=-78
    600600        ElseIf EndPos<=628 Then
    601             EndPos=EndPos-549.5
     601            EndPos -= 549.5
    602602            i3=78
    603603            i4=-78+Int(EndPos)
     
    631631
    632632    If bStep Then
    633         ex=sx+ex
    634         ey=sy+ey
     633        ex += sx
     634        ey += sy
    635635    Else
    636636        If fType Then
     
    754754            Input$=Input$+Chr$(_PromptSys_KeyChar)
    755755            _PromptSys_KeyChar=0
    756             i=i+1
     756            i++
    757757            If i>=length Then
    758758                Exit While
Note: See TracChangeset for help on using the changeset viewer.