I am new to Delphi. I have developed a VBA program which starts by reading in many small text files into an array using the code below. I am just starting to rewrite the program in Delphi 10.3.
Is there an equivalent code in Delphi? or
Suggestions welcome.
Set fso = CreateObject("scripting.filesystemobject")
Set MyFolder = fso.GetFolder(FileNameSource)
Set MyFileNames = MyFolder.Files
AllCount = MyFolder.Files.Count
ReDim AllMyWeeklyFileContents(1 To AllCount) As string
AllCount = 1
For Each MyFiles In MyFileNames
AFileName = MyFolder & "\" & MyFiles.Name
Set MyFileToRead = fso.GetFile(AFileName)
Set MyFileContent = MyFileToRead.OpenAsTextStream(ForReading, TristateUseDefault)
AllMyWeeklyFileContents(AllCount) = MyFileContent.ReadAll
AllCount = AllCount + 1
Next
Set fso = Nothing
Set MyFolder = Nothing