As my gift to the forum, I have an oddity in GetFileList that I was hoping someone else could verify.
To see it:
1. create a new folder anywhere that you and MS have full access to. I created "Test" under %Temp_Dir%.
2. In that folder, create several sequentially-named files (1.txt, 2.txt, 3.txt, or A.txt, B.txt, C.txt, etc, etc, etc.) and put something in them simple to display, to verify that you are seeing the correct file. (If A.txt, I put in "1", "2" in B.txt, etc, to make sure that I wasn't seeing the file name rather than the file contents.)
3. Run a GetfileList on that dir, but as the delimiter, choose CRLF rather than the default ";"
4. Separate them by CRLF.
5. Create a "Repeat-Until" loop, straight out of the help file, that displays the file name and path in a MDL message each loop, but add a "Length" command to get the number of characters for each entry, and a "ReadFile" to show the file contents, and display that as well.
6. Here's the oddity: In the lowest-named file (displayed last by GetFileList), the Length is reported as being one character longer (with the assumption that all the file names were the same length to begin with.)
7. This only happens when I use CRLF as the delimiter, and only to the lowest-named file. If I use ";" the length reported is correct, and everything works as expected.
8. If I try to use the result of GetFileList for that lowest-named file as a path for ReadFile or ReadLn, it fails with ##NOFILE##.
Here's my demo code:
Code: Select all
GetFileList>%Temp_Dir%Test\*.txt,TestFiles,CRLF
Sep>TestFiles,CRLF,TestFilesList
Let>L=0
Repeat>L
Let>L=L+1
Len>TestFilesList_%L%,Len
Let>FileName=TestFilesList_%L%
ReadFile>%FileName%,FileContents
Mdl>PathLength:%Len%%CRLF%Path:%FileName%%CRLF%FileContents:%FileContents%
Until>L=%TestFilesList_Count%

I'm on Windows 7 x64, with MS Pro 12.1.2.
That's it.
If I'm missing something obvious, feel free to harass me-I deserve it.
Thanks to all!
Alan