CSPro crash when using dirlist
Posted: August 6th, 2015, 11:22 am
Hey guys,
CSPro 6.1 crashes when you try to use the dirlist statement, if the directory is empty.
Is there a statement that allows you to check the number of files in a directory?
Thanks,
Pierre
CSPro 6.1 crashes when you try to use the dirlist statement, if the directory is empty.
Is there a statement that allows you to check the number of files in a directory?
Thanks,
Pierre
Code: Select all
if direxist(tmpStr)then
ok = dirlist(fileListing,tmpStr,"*.dat",recursive);
if ok then
// 123456789012345678
// 00_00_00_00000.DAT
tmpStr = fileListing(1);
tmpStr = tmpStr[1:length(tmpStr)-18] + "...\n\n";
do a = 1 while a <= length(fileListing)
tmpStr = tmpStr + edit("99",a) + ")" + fileListing(a)[length(fileListing(a))-18+1:18] + "\n";
enddo;
S_BLOCK = tmpStr;
endif;
endif;