<-- Previous || Up || Next -->

File Lines Like To String Sample Sub
Utilities Class

Private Sub FileLinesLikeToStringSample()
    Const strFn = "FileLinesLikeToStringSample"

    Dim strPattern As String
    strPattern = InputBox("Find LIKE pattern: ({Esc} cancels.)", strFn, "DLL")

    Dim strInFile As String
    strInFile = CombinePathAndFile(GetWindowsDirectory, "WIN.INI")
    strInFile = InputBox("Input file: ({Esc} cancels.)", strFn, strInFile)
    If Len(strInFile) = 0 Then Exit Sub

    Dim enumCompare As VbCompareMethod
    Select Case MsgBox("Use dictionary/text comparisons?  Choose No for literal/binary.", vbQuestion + vbYesNoCancel + vbDefaultButton1, strFn)
        Case vbYes
            enumCompare = vbTextCompare
        Case vbNo
            enumCompare = vbBinaryCompare
        Case vbCancel
            Exit Sub
        Case Else
            Stop
    End Select

    MsgBox TruncateRightWithEllipse(FileLinesLikeToString(strPattern, strInFile, intCompare), 1024), vbOKOnly, strFn
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.