Changeset 628 for trunk/ab5.0/ablib/src/basic/function.sbp
- Timestamp:
- Sep 21, 2008, 2:01:36 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.