Changeset 21


Ignore:
Timestamp:
Nov 27, 2006, 3:00:10 AM (17 years ago)
Author:
dai
Message:

String型パラメータのByRef指定がリテラル値指定を不可能にしていましたので、ファイルを前のバージョンに戻します。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/command.sbp

    r1 r21  
    3535
    3636Macro EXEC(lpFilePath As *Byte)(lpCmdLine As *Byte)
    37     ShellExecute(0, "open", lpFilePath, lpCmdLine, 0, SW_SHOWNORMAL)
     37    ShellExecute(0,"open",lpFilePath,lpCmdLine,0,SW_SHOWNORMAL)
    3838End Macro
    3939
     
    5656'----------------
    5757
    58 Macro MSGBOX(hWnd As HWND, ByRef str As String)(ByRef title As String, boxType As DWord, ByRef retAns As DWord)
     58Macro MSGBOX(hWnd As HWND, lpStr As String)(lpTitle As String, BoxType As DWord, ByRef retAns As DWord)
    5959    If VarPtr(retAns) Then
    60         retAns = MessageBox(hWnd, str, title, boxType)
     60        retAns=MessageBox(hWnd,lpStr,lpTitle,BoxType)
    6161    Else
    62         MessageBox(hWnd, str, title, boxType)
     62        MessageBox(hWnd,lpStr,lpTitle,BoxType)
    6363    End If
    6464End Macro
    6565
    66 Macro WINDOW(ByRef hWnd As Long, hOwner As HWND, x As Long, y As Long, nWidth As Long, nHeight As Long, ByRef title As String, dwStyle As DWord)(ByRef className As String, id As DWord, lpFunc As DWord, dwExStyle As DWord)
     66Macro WINDOW(ByRef hWnd As Long, hOwner As Long, x As Long, y As Long, nWidth As Long, nHeight As Long, lpTitle As String, dwStyle As DWord)(lpClass As String, id As DWord, lpFunc As DWord, dwExStyle As DWord)
    6767    If VarPtr(hWnd) Then
    68         hWnd = CreateWindowEx(dwExStyle, className.Chars, title, dwStyle, x, y, nWidth, nHeight, hOwner, id, GetModuleHandle(0), NULL)
     68        hWnd=CreateWindowEx(dwExStyle,lpClass,lpTitle,dwStyle,x,y,nWidth,nHeight,hOwner,id,GetModuleHandle(0),NULL)
    6969    Else
    70         CreateWindowEx(dwExStyle, className.Chars, title, dwStyle, x, y, nWidth, nHeight, hOwner, id, GetModuleHandle(0), NULL)
     70        CreateWindowEx(dwExStyle,lpClass,lpTitle,dwStyle,x,y,nWidth,nHeight,hOwner,id,GetModuleHandle(0),NULL)
    7171    End If
    7272End Macro
     
    7676End Macro
    7777
    78 Macro INSMENU(hMenu As HMENU, PosID As Long, flag As Long)(ByRef str As String, id As Long, hSubMenu As HMENU, state As Long)
     78Macro INSMENU(hMenu As HMENU, PosID As Long, flag As Long)(lpString As String, id As Long, hSubMenu As HMENU, state As Long)
    7979    Dim mii As MENUITEMINFO
    8080
    81     ZeroMemory(VarPtr(mii), Len(mii))
    82     With mii
    83         .cbSize = Len(mii)
    84         .fMask = IIM_TYPE
    85 
    86         If str.Length = 0 Then
    87             .fType = MFT_SEPARATOR
    88         Else
    89             .fType  = MFT_STRING
    90             .fMask = .fMask or MIIM_STATE or MIIM_ID
    91             .dwTypeData = str.Chars
    92             .wID = id
    93             If hSubMenu Then
    94                 .fMask = .fMask or MIIM_SUBMENU
    95                 .hSubMenu = hSubMenu
    96             End If
    97             .fState = state
     81    FillMemory(VarPtr(mii),Len(mii),0)
     82    mii.cbSize=Len(mii)
     83    mii.fMask=MIIM_TYPE
     84
     85    If lpString.Length=0 Then
     86        mii.fType=MFT_SEPARATOR
     87    Else
     88        mii.fType=MFT_STRING
     89        mii.fMask=mii.fMask or MIIM_STATE or MIIM_ID
     90        mii.dwTypeData=StrPtr(lpString)
     91        mii.wID=id
     92        If hSubMenu Then
     93            mii.fMask=mii.fMask or MIIM_SUBMENU
     94            mii.hSubMenu=hSubMenu
    9895        End If
    99     End With
    100 
    101     InsertMenuItem(hMenu, PosID, flag, mii)
     96        mii.fState=state
     97    End If
     98
     99    InsertMenuItem(hMenu,PosID,flag,mii)
    102100End Macro
    103101
     
    107105'--------------
    108106
    109 Dim _System_hFile[255] As HANDLE
    110 
    111 Macro OPEN(ByRef fileName As String, AccessFor As Long, FileNumber As Long)
     107Dim _System_hFile(255) As Long
     108Macro OPEN(lpFileName As String, AccessFor As Long, FileNumber As Long)
    112109    Dim dwAccess As Long
    113110    Dim bAppend As Long
    114111    Dim dwCreationDisposition As Long
    115112
    116     FileNumber--
     113    FileNumber=FileNumber-1
    117114
    118115    bAppend=0
     
    133130    End Select
    134131
    135     _System_hFile[FileNumber] = CreateFile(fileName, dwAccess, 0, ByVal 0, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, 0)
    136 
    137     If bAppend Then SetFilePointer(_System_hFile[FileNumber], 0, 0, FILE_END)
    138 End Macro
    139 
     132    _System_hFile(FileNumber)=CreateFile(lpFileName,dwAccess,0,ByVal NULL,dwCreationDisposition,FILE_ATTRIBUTE_NORMAL,NULL)
     133
     134    If bAppend Then SetFilePointer(_System_hFile(FileNumber),0,NULL,FILE_END)
     135End Macro
    140136Macro CLOSE()(FileNumber As Long)
    141     FileNumber--
     137    FileNumber=FileNumber-1
    142138
    143139    If _System_hFile(FileNumber) Then
    144         CloseHandle(_System_hFile[FileNumber])
    145         _System_hFile(FileNumber) = 0
     140        CloseHandle(_System_hFile(FileNumber))
     141        _System_hFile(FileNumber)=0
    146142    End If
    147143End Macro
     
    151147Dim _System_InputDataType[_System_MAX_PARMSNUM] As DWord
    152148Sub INPUT_FromFile(FileNumber As Long)
    153     Dim i As Long, i2 As Long, i3 As Long
     149    Dim i As Long ,i2 As Long, i3 As Long
    154150    Dim buffer As String
    155151    Dim temp[1] As Byte
     
    157153    Dim IsStr As Long
    158154
    159     FileNumber--
     155    FileNumber=FileNumber-1
    160156
    161157    buffer=ZeroString(GetFileSize(_System_hFile[FileNumber],0))
     
    177173        IsStr=0
    178174        While 1
    179             i3++
     175            i3=i3+1
    180176
    181177            i2=ReadFile(_System_hFile[FileNumber],temp,1,VarPtr(dwAccessBytes),ByVal 0)
     
    201197                        If dwAccessBytes=0 Then Exit While
    202198                        If temp[0]=Asc(",") Then Exit While
    203                         If temp[0] <> 32 And temp[0] <> 9 Then
     199                        If Not(temp[0]=32 or temp[0]=9) Then
    204200                            SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT)
    205201                            Exit While
     
    231227                Dim pTempStr As *String
    232228                pTempStr=_System_InputDataPtr[i] As *String
    233                 pTempStr->Assign(buffer.Chars, i3)
     229
     230                pTempStr->Length=i3
     231                pTempStr->Chars=_System_realloc(pTempStr->Chars,pTempStr->Length+1)
     232                memcpy(pTempStr->Chars,buffer.Chars,pTempStr->Length)
     233                pTempStr->Chars[pTempStr->Length]=0
    234234        End Select
    235235
    236         i++
     236        i=i+1
    237237        If _System_InputDataPtr[i]=0 Then Exit While
    238238    Wend
     
    241241Sub PRINT_ToFile(FileNumber As Long, buf As String)
    242242    Dim dwAccessByte As DWord
    243     FileNumber--
     243    FileNumber=FileNumber-1
    244244
    245245    WriteFile(_System_hFile(FileNumber),buf,Len(buf),VarPtr(dwAccessByte),ByVal NULL)
     
    263263            buffer[i3]=UsingStr[i2]
    264264            If UsingStr[i2]=0 Then Exit While
    265             i2++
    266             i3++
     265            i2=i2+1
     266            i3=i3+1
    267267        Wend
    268268
     
    274274
    275275            Dim length_num As Long, length_buf As Long
    276             Dim dblRoundOff = 0 As Double
     276            Dim dblRoundOff=0 As Double
    277277
    278278
     
    283283            i4=i2
    284284            While UsingStr[i4]=Asc("#")
    285                 i4++
     285                i4=i4+1
    286286            Wend
    287287            If UsingStr[i4]=Asc(".") Then
    288                 i4++
     288                i4=i4+1
    289289
    290290                dblRoundOff=0.5
    291291                While UsingStr[i4]=Asc("#")
    292                     i4++
     292                    i4=i4+1
    293293                    dblRoundOff=dblRoundOff/10
    294294                Wend
     
    304304
    305305            '符号が有る場合は、一文字分のスペースを考慮する
    306             If sign Then length_num++
     306            If sign Then length_num=length_num+1
    307307
    308308            length_buf=0
    309309            Do
    310                 i2++
    311                 length_buf++
     310                i2=i2+1
     311                length_buf=length_buf+1
    312312            Loop While UsingStr[i2]=Asc("#")
    313313
     
    315315                '通常時
    316316                FillMemory(StrPtr(buffer)+i3,length_buf-length_num,Asc(" "))
    317                 i3 += length_buf - length_num
     317                i3=i3+(length_buf-length_num)
    318318
    319319                If sign Then
    320320                    buffer[i3]=Asc("-")
    321                     i3++
    322 
    323                     length_num--
     321                    i3=i3+1
     322
     323                    length_num=length_num-1
    324324                End If
    325325
     
    330330                End If
    331331
    332                 i3 += length_num
     332                i3=i3+length_num
    333333            Else
    334334                '表示桁が足りないとき
    335335                FillMemory(StrPtr(buffer)+i3,length_buf,Asc("#"))
    336                 i3 += length_buf
     336                i3=i3+length_buf
    337337            End If
    338338
    339339            If UsingStr[i2]=Asc(".") Then
    340340                buffer[i3]=UsingStr[i2]
    341                 i2++
    342                 i3++
     341                i2=i2+1
     342                i3=i3+1
    343343
    344344                i4=dec
     
    349349                        buffer[i3]=temp2[i4]
    350350                    End If
    351                     i3++
    352                     i4++
    353 
    354                     i2++
     351                    i3=i3+1
     352                    i4=i4+1
     353
     354                    i2=i2+1
    355355                Wend
    356356            End If
    357357        ElseIf UsingStr[i2]=Asc("@") Then
    358             i2++1
     358            i2=i2+1
    359359
    360360            lstrcat(StrPtr(buffer)+i3,_System_UsingStrData[ParmNum])
    361             i3 += lstrlen(_System_UsingStrData[ParmNum])
     361            i3=i3+lstrlen(_System_UsingStrData[ParmNum])
    362362        ElseIf UsingStr[i2]=Asc("&") Then
    363363            i4=0
    364364            Do
    365                 i4++
    366                 i2++
     365                i4=i4+1
     366                i2=i2+1
    367367            Loop While UsingStr[i2]=Asc(" ")
    368368
    369369            If UsingStr[i2]=Asc("&") Then
    370                 i4++
    371                 i2++
     370                i4=i4+1
     371                i2=i2+1
    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 += i4
     379                i3=i3+i4
    380380            Else
    381                 i2 -= i4
     381                i2=i2-i4
    382382                buffer[i3]=Asc("&")
    383                 i2++
    384                 i3++
     383                i2=i2+1
     384                i3=i3+1
    385385                Continue
    386386            End If
    387387        End If
    388388
    389         ParmNum++
     389        ParmNum=ParmNum+1
    390390    Wend
    391391
    392392    _System_GetUsingFormat=Left$(buffer,lstrlen(buffer))
    393393End Function
    394 
    395394Sub PRINTUSING_ToFile(FileNumber As Long, UsingStr As String)
    396395    Dim dwAccessByte As DWord
    397396    Dim buf As String
    398397
    399     FileNumber--
     398    FileNumber=FileNumber-1
    400399    buf=_System_GetUsingFormat(UsingStr)
    401400
     
    404403
    405404Dim _System_FieldSize(255) As Long
    406 
    407405Macro FIELD(FileNumber As Long, FieldSize As Long)
    408     FileNumber--
     406    FileNumber=FileNumber-1
    409407
    410408    _System_FieldSize(FileNumber)=FieldSize
    411409End Macro
    412 
    413410Macro GET(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)
    414411    Dim dwAccessByte As Long
    415412
    416     FileNumber--
    417     RecodeNumber--
     413    FileNumber=FileNumber-1
     414    RecodeNumber=RecodeNumber-1
    418415
    419416    SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN)
     
    424421    End If
    425422End Macro
    426 
    427423Macro PUT(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)
    428424    Dim dwAccessByte As Long
    429425
    430     FileNumber--
    431     RecodeNumber--
     426    FileNumber=FileNumber-1
     427    RecodeNumber=RecodeNumber-1
    432428
    433429    SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN)
     
    435431End Macro
    436432
    437 Macro CHDIR(ByRef path As String)
     433Macro CHDIR(path As String)
    438434    SetCurrentDirectory(path)
    439435End Macro
    440 
    441 Macro MKDIR(ByRef path As String)
     436Macro MKDIR(path As String)
    442437    CreateDirectory(path,ByVal 0)
    443438End Macro
    444 
    445 Macro KILL(ByRef path As String)
     439Macro KILL(path As String)
    446440    DeleteFile(path)
    447441End Macro
Note: See TracChangeset for help on using the changeset viewer.