RecLFile.SETRANGE(Path, MySearchigFolder); RecLFile.SETRANGE(RecLFile."Is a file", TRUE); IF RecLFile.FIND('-') THEN BEGIN //somethig what you want UNTIL RecLFile.NEXT = 0;This C/AL will works with no error if MySearchigFolder is not nested too deep. If MySearchigFolder is for instance "C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\users\DOM\John.Parker\TEMP" (default value of TEMPORARYPATH) the error (The maximum length for a string value is 98.) will displayed because field Path in table File is declared as text 98.
Answers
.NET is power under your thumps
I wrote about it too
https://forum.mibuso.com/discussion/29301/read-multiple-txt-files-from-a-directory
Maybe because he wants his code to be future-proof (D365/extensions). But then again, when you're targetting D365 you wouldn't be talking about files and directories