Ignore:
Timestamp:
Sep 21, 2008, 2:01:36 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

winnls.ab, winsvc.abを追加

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/basic/function.sbp

    r589 r628  
    123123*/
    124124Function Sgn(n As Double) As Long
    125 '   Sgn = ActiveBasic..Math.Sign(n)
     125'   Sgn = ActiveBasic.Math.Sign(n)
    126126End Function
    127127
     
    205205        Return New String(t, 2)
    206206    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")
    208208    End If
    209209End Function
     
    665665Function Eof(FileNum As Long) As Long
    666666    FileNum--
     667    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum)
    667668    Dim dwCurrent = SetFilePointer(_System_hFile(FileNum), 0,NULL, FILE_CURRENT)
    668669    Dim dwEnd = SetFilePointer(_System_hFile(FileNum), 0, NULL, FILE_END)
     
    677678
    678679Function 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)
    680683End Function
    681684
    682685Function Loc(FileNum As Long) As Long
    683686    FileNum--
    684 
     687    ActiveBasic.Detail.ThrowIfInvaildFileNum(FileNum)
    685688    Dim NowPos = SetFilePointer(_System_hFile(FileNum), 0, 0, FILE_CURRENT)
    686689    Dim BeginPos = SetFilePointer(_System_hFile(FileNum), 0, 0, FILE_BEGIN)
     
    690693End Function
    691694
     695Namespace ActiveBasic
     696Namespace Detail
     697
     698Sub 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
     704End Sub
     705
     706End Namespace
     707End Namespace
    692708
    693709'------------------
Note: See TracChangeset for help on using the changeset viewer.