You are here: PSPad forum > Bug report / Hlášení chyb > ProjectFilesList() doesn't return files from the top level
Posted by: gwinkless | Date: 2014-07-01 13:36 | IP: IP Logged
Hi
The pspad projectFiles function seems to miss out files in the root.
Eg I create a folder "C:\MyTestProject", create a subfolder (Folder1), add "C:\MyTestProject\file1.txt", "C:\MyTestProject\file2.txt" and "C:\MyTestProject\Folder1\file3.txt", then create a project from that folder and run some jscript:
logClear();
logSetTypeList();
for (fn=1; fn <= projectFilesCount(); fn++) {
logAddLine(projectFiles(fn));
}
I get
MyTestProject
Folder1
C:\MyTestProject\Folder1\file3.txt
No sign of file1.txt or file2.txt :(
The ppr project tree is:
[Project tree]
MyTestProject
+MyTestProject
+Folder1
MyTestProject\Folder1\file3.txt
MyTestProject\file1.txt
MyTestProject\file2.txt
Any thoughts?
I started out with
for (fn=0; fn < projectFilesCount(); fn++) {
but that misses out the last file and outputs MyTestProject twice (so I assume it should be 1-based?)
Geoff
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR