Changeset 628 for trunk/ab5.0/ablib/src/basic
- Timestamp:
- Sep 21, 2008, 2:01:36 AM (17 years ago)
- Location:
- trunk/ab5.0/ablib/src/basic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/basic/command.sbp
r497 r628 59 59 60 60 Macro MSGBOX(hwnd As HWND, str As String)(title As String, boxType As DWord, ByRef retAns As DWord) 61 'Dim ret = MessageBox(hwnd, ToTCStr(str), ToTCStr(title), boxType)62 'If VarPtr(retAns) Then63 'retAns = ret64 'End If61 Dim ret = MessageBox(hwnd, ToTCStr(str), ToTCStr(title), boxType) 62 If VarPtr(retAns) Then 63 retAns = ret 64 End If 65 65 End Macro 66 66 … … 136 136 Macro CLOSE()(FileNumber As Long) 137 137 FileNumber-- 138 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber) 138 139 139 140 If _System_hFile(FileNumber) Then … … 148 149 Sub INPUT_FromFile(FileNumber As Long) 149 150 FileNumber-- 151 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber) 150 152 151 153 Dim i = 0 As Long … … 238 240 Dim dwAccessByte As DWord 239 241 FileNumber-- 242 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber) 240 243 241 244 WriteFile(_System_hFile(FileNumber), StrPtr(buf), Len(buf), VarPtr(dwAccessByte), ByVal 0) … … 404 407 Macro FIELD(FileNumber As Long, FieldSize As Long) 405 408 FileNumber-- 409 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber) 406 410 _System_FieldSize(FileNumber)=FieldSize 407 411 End Macro … … 410 414 411 415 FileNumber-- 416 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber) 412 417 RecodeNumber-- 413 418 … … 425 430 426 431 FileNumber-- 432 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNumber) 427 433 RecodeNumber-- 428 434 -
trunk/ab5.0/ablib/src/basic/function.sbp
r589 r628 123 123 */ 124 124 Function Sgn(n As Double) As Long 125 ' Sgn = ActiveBasic. .Math.Sign(n)125 ' Sgn = ActiveBasic.Math.Sign(n) 126 126 End Function 127 127 … … 205 205 Return New String(t, 2) 206 206 Else 207 Throw New System.ArgumentOutOfRangeException("ChrW: c is invalid Unicode code point.", "c")207 Throw New System.ArgumentOutOfRangeException("ChrW: c is invalid unicode code point.", "c") 208 208 End If 209 209 End Function … … 665 665 Function Eof(FileNum As Long) As Long 666 666 FileNum-- 667 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum) 667 668 Dim dwCurrent = SetFilePointer(_System_hFile(FileNum), 0,NULL, FILE_CURRENT) 668 669 Dim dwEnd = SetFilePointer(_System_hFile(FileNum), 0, NULL, FILE_END) … … 677 678 678 679 Function Lof(FileNum As Long) As Long 679 Lof = GetFileSize(_System_hFile(FileNum-1), 0) 680 FileNum-- 681 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum) 682 Lof = GetFileSize(_System_hFile(FileNum), 0) 680 683 End Function 681 684 682 685 Function Loc(FileNum As Long) As Long 683 686 FileNum-- 684 687 ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum) 685 688 Dim NowPos = SetFilePointer(_System_hFile(FileNum), 0, 0, FILE_CURRENT) 686 689 Dim BeginPos = SetFilePointer(_System_hFile(FileNum), 0, 0, FILE_BEGIN) … … 690 693 End Function 691 694 695 Namespace ActiveBasic 696 Namespace Detail 697 698 Sub ThrowIfInvaildFileNum(n As Long) 699 If n < 0 Or n > 255 Then 700 Throw New System.ArgumentOutOfRangeException("FileNum", "Invalid file number") 701 ElseIf _System_hFile(n) = 0 Then 702 Throw New System.InvalidOperationException("File number " & Str$(n + 1) & "is not opend.") 703 End If 704 End Sub 705 706 End Namespace 707 End Namespace 692 708 693 709 '------------------
Note:
See TracChangeset
for help on using the changeset viewer.