Changeset 303 for trunk/Include/basic
- Timestamp:
- Aug 24, 2007, 11:14:46 AM (17 years ago)
- Location:
- trunk/Include/basic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/basic/command.sbp
r288 r303 7 7 #require <windows.sbp> 8 8 #require <Classes/System/Environment.ab> 9 #require <Classes/ActiveBasic/Windows/Windows.ab> 9 10 10 11 Const _System_Type_SByte = 1 … … 65 66 '---------------- 66 67 67 Function _System_MessageBox(hw As HWND, s As PCSTR, t As PCSTR, b As DWord) As DWord68 Return MessageBoxA(hw, s, t, b)69 End Function70 71 Function _System_MessageBox(hw As HWND, s As PCWSTR, t As PCWSTR, b As DWord) As DWord72 Return MessageBoxW(hw, s, t, b)73 End Function74 75 68 Macro MSGBOX(hwnd As HWND, str As String)(title As String, boxType As DWord, ByRef retAns As DWord) 69 Dim ret = ActiveBasic.Windows.Detail._System_MessageBox(hwnd, ToSCStr(str), ToSCStr(title), boxType) 76 70 If VarPtr(retAns) Then 77 retAns = _System_MessageBox(hwnd, ToSCStr(str), ToSCStr(title), boxType) 78 Else 79 _System_MessageBox(hwnd, ToSCStr(str), ToSCStr(title), boxType) 71 retAns = ret 80 72 End If 81 73 End Macro … … 424 416 Macro FIELD(FileNumber As Long, FieldSize As Long) 425 417 FileNumber-- 426 427 418 _System_FieldSize(FileNumber)=FieldSize 428 419 End Macro 429 Macro GET(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)420 Macro GET(FileNumber As Long, RecodeNumber As Long, ByRef buffer As String) 430 421 Dim dwAccessByte As DWord 431 422 … … 434 425 435 426 SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN) 436 lpBuffer = ZeroString(_System_FieldSize(FileNumber)) 437 ReadFile(_System_hFile(FileNumber), StrPtr(lpBuffer), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte),ByVal 0) 438 If Not dwAccessByte=_System_FieldSize(FileNumber) Then 439 lpBuffer = Left$(lpBuffer, dwAccessByte) 427 Dim t = ZeroString(_System_FieldSize(FileNumber)) 428 ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0) 429 If dwAccessByte = _System_FieldSize(FileNumber) Then 430 buffer = t.ToString 431 Else 432 buffer = Left$(t.ToString, dwAccessByte) 440 433 End If 441 434 End Macro 442 Macro PUT(FileNumber As Long, RecodeNumber As Long, ByRef lpBuffer As String)435 Macro PUT(FileNumber As Long, RecodeNumber As Long, buffer As String) 443 436 Dim dwAccessByte As DWord 444 437 … … 447 440 448 441 SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN) 449 WriteFile(_System_hFile(FileNumber), StrPtr( lpBuffer),SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)442 WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0) 450 443 End Macro 451 444 -
trunk/Include/basic/function.sbp
r289 r303 1019 1019 End Function 1020 1020 1021 Function _System_PtrObj(p As VoidPtr) As Object 1022 SetPointer(VarPtr(_System_PtrObj), p) 1023 End Function 1024 1021 1025 '-------- 1022 1026 ' 文字列関数その2
Note:
See TracChangeset
for help on using the changeset viewer.