I have a procedure which checks for receipt files.
The following procedure works in that it amalgamates all
the files into one file; but the file names are retrieved in no particular order, which means receipts are not ordered.
Open MyFileOut For Output As #2
MyName = Dir(MyCriteria) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
MyFile = MyPath & MyName
If IsNumeric(Right(MyName, 1)) Then
Open MyFile For Input As #1
Do While Not EOF(1)
Line Input #1, A1
Print #2, A1
Loop
Close #1
End If
MyName = Dir ' Get next entry.
Loop
Close #2
Microsoft Help says you may want to store returned file names in an array and then sort the array. How do I do this?
The following procedure works in that it amalgamates all
the files into one file; but the file names are retrieved in no particular order, which means receipts are not ordered.
Open MyFileOut For Output As #2
MyName = Dir(MyCriteria) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
MyFile = MyPath & MyName
If IsNumeric(Right(MyName, 1)) Then
Open MyFile For Input As #1
Do While Not EOF(1)
Line Input #1, A1
Print #2, A1
Loop
Close #1
End If
MyName = Dir ' Get next entry.
Loop
Close #2
Microsoft Help says you may want to store returned file names in an array and then sort the array. How do I do this?