Changes in Include/basic/command.sbp [21:1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/basic/command.sbp
r21 r1 35 35 36 36 Macro 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) 38 38 End Macro 39 39 … … 56 56 '---------------- 57 57 58 Macro MSGBOX(hWnd As HWND, lpStr As String)(lpTitle As String, BoxType As DWord, ByRef retAns As DWord)58 Macro MSGBOX(hWnd As HWND, ByRef str As String)(ByRef title As String, boxType As DWord, ByRef retAns As DWord) 59 59 If VarPtr(retAns) Then 60 retAns =MessageBox(hWnd,lpStr,lpTitle,BoxType)60 retAns = MessageBox(hWnd, str, title, boxType) 61 61 Else 62 MessageBox(hWnd, lpStr,lpTitle,BoxType)62 MessageBox(hWnd, str, title, boxType) 63 63 End If 64 64 End Macro 65 65 66 Macro 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)(lpClassAs String, id As DWord, lpFunc As DWord, dwExStyle As DWord)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) 67 67 If VarPtr(hWnd) Then 68 hWnd =CreateWindowEx(dwExStyle,lpClass,lpTitle,dwStyle,x,y,nWidth,nHeight,hOwner,id,GetModuleHandle(0),NULL)68 hWnd = CreateWindowEx(dwExStyle, className.Chars, title, dwStyle, x, y, nWidth, nHeight, hOwner, id, GetModuleHandle(0), NULL) 69 69 Else 70 CreateWindowEx(dwExStyle, lpClass,lpTitle,dwStyle,x,y,nWidth,nHeight,hOwner,id,GetModuleHandle(0),NULL)70 CreateWindowEx(dwExStyle, className.Chars, title, dwStyle, x, y, nWidth, nHeight, hOwner, id, GetModuleHandle(0), NULL) 71 71 End If 72 72 End Macro … … 76 76 End Macro 77 77 78 Macro INSMENU(hMenu As HMENU, PosID As Long, flag As Long)( lpStringAs String, id As Long, hSubMenu As HMENU, state As Long)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) 79 79 Dim mii As MENUITEMINFO 80 80 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 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 95 98 End If 96 mii.fState=state 97 End If 98 99 InsertMenuItem(hMenu,PosID,flag,mii) 99 End With 100 101 InsertMenuItem(hMenu, PosID, flag, mii) 100 102 End Macro 101 103 … … 105 107 '-------------- 106 108 107 Dim _System_hFile(255) As Long 108 Macro OPEN(lpFileName As String, AccessFor As Long, FileNumber As Long) 109 Dim _System_hFile[255] As HANDLE 110 111 Macro OPEN(ByRef fileName As String, AccessFor As Long, FileNumber As Long) 109 112 Dim dwAccess As Long 110 113 Dim bAppend As Long 111 114 Dim dwCreationDisposition As Long 112 115 113 FileNumber =FileNumber-1116 FileNumber-- 114 117 115 118 bAppend=0 … … 130 133 End Select 131 134 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) 135 End Macro 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 136 140 Macro CLOSE()(FileNumber As Long) 137 FileNumber =FileNumber-1141 FileNumber-- 138 142 139 143 If _System_hFile(FileNumber) Then 140 CloseHandle(_System_hFile (FileNumber))141 _System_hFile(FileNumber) =0144 CloseHandle(_System_hFile[FileNumber]) 145 _System_hFile(FileNumber) = 0 142 146 End If 143 147 End Macro … … 147 151 Dim _System_InputDataType[_System_MAX_PARMSNUM] As DWord 148 152 Sub INPUT_FromFile(FileNumber As Long) 149 Dim i As Long ,i2 As Long, i3 As Long153 Dim i As Long, i2 As Long, i3 As Long 150 154 Dim buffer As String 151 155 Dim temp[1] As Byte … … 153 157 Dim IsStr As Long 154 158 155 FileNumber =FileNumber-1159 FileNumber-- 156 160 157 161 buffer=ZeroString(GetFileSize(_System_hFile[FileNumber],0)) … … 173 177 IsStr=0 174 178 While 1 175 i3 =i3+1179 i3++ 176 180 177 181 i2=ReadFile(_System_hFile[FileNumber],temp,1,VarPtr(dwAccessBytes),ByVal 0) … … 197 201 If dwAccessBytes=0 Then Exit While 198 202 If temp[0]=Asc(",") Then Exit While 199 If Not(temp[0]=32 or temp[0]=9)Then203 If temp[0] <> 32 And temp[0] <> 9 Then 200 204 SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT) 201 205 Exit While … … 227 231 Dim pTempStr As *String 228 232 pTempStr=_System_InputDataPtr[i] As *String 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 233 pTempStr->Assign(buffer.Chars, i3) 234 234 End Select 235 235 236 i =i+1236 i++ 237 237 If _System_InputDataPtr[i]=0 Then Exit While 238 238 Wend … … 241 241 Sub PRINT_ToFile(FileNumber As Long, buf As String) 242 242 Dim dwAccessByte As DWord 243 FileNumber =FileNumber-1243 FileNumber-- 244 244 245 245 WriteFile(_System_hFile(FileNumber),buf,Len(buf),VarPtr(dwAccessByte),ByVal NULL) … … 263 263 buffer[i3]=UsingStr[i2] 264 264 If UsingStr[i2]=0 Then Exit While 265 i2 =i2+1266 i3 =i3+1265 i2++ 266 i3++ 267 267 Wend 268 268 … … 274 274 275 275 Dim length_num As Long, length_buf As Long 276 Dim dblRoundOff =0 As Double276 Dim dblRoundOff = 0 As Double 277 277 278 278 … … 283 283 i4=i2 284 284 While UsingStr[i4]=Asc("#") 285 i4 =i4+1285 i4++ 286 286 Wend 287 287 If UsingStr[i4]=Asc(".") Then 288 i4 =i4+1288 i4++ 289 289 290 290 dblRoundOff=0.5 291 291 While UsingStr[i4]=Asc("#") 292 i4 =i4+1292 i4++ 293 293 dblRoundOff=dblRoundOff/10 294 294 Wend … … 304 304 305 305 '符号が有る場合は、一文字分のスペースを考慮する 306 If sign Then length_num =length_num+1306 If sign Then length_num++ 307 307 308 308 length_buf=0 309 309 Do 310 i2 =i2+1311 length_buf =length_buf+1310 i2++ 311 length_buf++ 312 312 Loop While UsingStr[i2]=Asc("#") 313 313 … … 315 315 '通常時 316 316 FillMemory(StrPtr(buffer)+i3,length_buf-length_num,Asc(" ")) 317 i3 =i3+(length_buf-length_num)317 i3 += length_buf - length_num 318 318 319 319 If sign Then 320 320 buffer[i3]=Asc("-") 321 i3 =i3+1322 323 length_num =length_num-1321 i3++ 322 323 length_num-- 324 324 End If 325 325 … … 330 330 End If 331 331 332 i3 =i3+length_num332 i3 += length_num 333 333 Else 334 334 '表示桁が足りないとき 335 335 FillMemory(StrPtr(buffer)+i3,length_buf,Asc("#")) 336 i3 =i3+length_buf336 i3 += length_buf 337 337 End If 338 338 339 339 If UsingStr[i2]=Asc(".") Then 340 340 buffer[i3]=UsingStr[i2] 341 i2 =i2+1342 i3 =i3+1341 i2++ 342 i3++ 343 343 344 344 i4=dec … … 349 349 buffer[i3]=temp2[i4] 350 350 End If 351 i3 =i3+1352 i4 =i4+1353 354 i2 =i2+1351 i3++ 352 i4++ 353 354 i2++ 355 355 Wend 356 356 End If 357 357 ElseIf UsingStr[i2]=Asc("@") Then 358 i2 =i2+1358 i2++1 359 359 360 360 lstrcat(StrPtr(buffer)+i3,_System_UsingStrData[ParmNum]) 361 i3 =i3+lstrlen(_System_UsingStrData[ParmNum])361 i3 += lstrlen(_System_UsingStrData[ParmNum]) 362 362 ElseIf UsingStr[i2]=Asc("&") Then 363 363 i4=0 364 364 Do 365 i4 =i4+1366 i2 =i2+1365 i4++ 366 i2++ 367 367 Loop While UsingStr[i2]=Asc(" ") 368 368 369 369 If UsingStr[i2]=Asc("&") Then 370 i4 =i4+1371 i2 =i2+1370 i4++ 371 i2++ 372 372 i5=lstrlen(_System_UsingStrData[ParmNum]) 373 373 If i4<=i5 Then … … 377 377 End If 378 378 memcpy(StrPtr(buffer)+i3,_System_UsingStrData[ParmNum],i5) 379 i3 =i3+i4379 i3 += i4 380 380 Else 381 i2 =i2-i4381 i2 -= i4 382 382 buffer[i3]=Asc("&") 383 i2 =i2+1384 i3 =i3+1383 i2++ 384 i3++ 385 385 Continue 386 386 End If 387 387 End If 388 388 389 ParmNum =ParmNum+1389 ParmNum++ 390 390 Wend 391 391 392 392 _System_GetUsingFormat=Left$(buffer,lstrlen(buffer)) 393 393 End Function 394 394 395 Sub PRINTUSING_ToFile(FileNumber As Long, UsingStr As String) 395 396 Dim dwAccessByte As DWord 396 397 Dim buf As String 397 398 398 FileNumber =FileNumber-1399 FileNumber-- 399 400 buf=_System_GetUsingFormat(UsingStr) 400 401 … … 403 404 404 405 Dim _System_FieldSize(255) As Long 406 405 407 Macro FIELD(FileNumber As Long, FieldSize As Long) 406 FileNumber =FileNumber-1408 FileNumber-- 407 409 408 410 _System_FieldSize(FileNumber)=FieldSize 409 411 End Macro 412 410 413 Macro GET(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String) 411 414 Dim dwAccessByte As Long 412 415 413 FileNumber =FileNumber-1414 RecodeNumber =RecodeNumber-1416 FileNumber-- 417 RecodeNumber-- 415 418 416 419 SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN) … … 421 424 End If 422 425 End Macro 426 423 427 Macro PUT(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String) 424 428 Dim dwAccessByte As Long 425 429 426 FileNumber =FileNumber-1427 RecodeNumber =RecodeNumber-1430 FileNumber-- 431 RecodeNumber-- 428 432 429 433 SetFilePointer(_System_hFile(FileNumber),RecodeNumber*_System_FieldSize(FileNumber),NULL,FILE_BEGIN) … … 431 435 End Macro 432 436 433 Macro CHDIR( path As String)437 Macro CHDIR(ByRef path As String) 434 438 SetCurrentDirectory(path) 435 439 End Macro 436 Macro MKDIR(path As String) 440 441 Macro MKDIR(ByRef path As String) 437 442 CreateDirectory(path,ByVal 0) 438 443 End Macro 439 Macro KILL(path As String) 444 445 Macro KILL(ByRef path As String) 440 446 DeleteFile(path) 441 447 End Macro
Note:
See TracChangeset
for help on using the changeset viewer.