经典ASP:无法从函数返回False,我收到类型不匹配错误

时间:2019-12-20 16:11:44

标签: vbscript asp-classic

' Determines if a file contains any of an array of lines.
' Case insensitive comparison.
Function DoesFileContainAnyLine(filename, lines)
    Dim fs
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    If fs.FileExists(filename) Then
        set f = fs.OpenTextFile(filename, 1, true) 
        Do Until f.AtEndOfStream 
            Dim line
            line = f.ReadLine
            For Each needle in lines
                if LCase(Trim(needle)) = LCase(Trim(line)) Then
                    return true
                end if
            Next
        Loop
    End If
    Return False
End Function

Return False行上出现类型不匹配错误;为什么我不能从函数返回false?

0 个答案:

没有答案