Private Sub SortFileLinesSample() Const strFn = "SortFileLinesSample" Dim strInFile As String strInFile = CombinePathAndFile(GetWindowsDirectory, "W*.INI") strInFile = InputBox("Input file(s): (Wildcards allowed; {Esc} cancels.)", strFn, strInFile) If Len(strInFile) = 0 Then Exit Sub Dim strOutFile As String strOutFile = GetTempFileName(Null, strFn) strOutFile = InputBox("Output file: (FILE WILL BE OVERWRITTEN; {Esc} cancels.)", strFn, strOutFile) If Len(strOutFile) = 0 Then Exit Sub Dim enumCompare As VbCompareMethod Select Case MsgBox("Use dictionary/text sort order and 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 Dim intUnique As Integer Select Case MsgBox("Write unique lines only?", vbQuestion + vbYesNoCancel + vbDefaultButton2, strFn) Case vbYes intUnique = True Case vbNo intUnique = False Case vbCancel Exit Sub Case Else Stop End Select MsgBox "Return = " & SortFileLines(est, strInFile, strOutFile, intCompare, intUnique) & " (True means success; False means failure.)", vbInformation, strFn Debug.Print est.MessageText End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.