neingeist
/
arduinisten
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

31 lines
1012 B
Plaintext

15 years ago
#usage "<b>run a ULP through all libraries in a directory</b><p>\n"
"This is an example how to loop through all libraries in a directory "
"and counts the devices.<p>"
"Load any library from the library directory and execute the ULP.<p>"
"<author>Author: support@cadsoft.de</author><p><p>"
string a[], cmd;
//-------- main program --------------------------------------------------
if (library) {
library(L) {
string lbr_path = filedir(L.name);
string ulpFile = dlgFileOpen("Select a ULP to run in LBRs", "", "*.ulp");
if (!ulpFile) exit(0); // 2006.02.20 librarian@cadsoft.de
int n = fileglob(a, lbr_path + "*.lbr");
if (n) {
for (int xl = 0; xl < n; xl++) {
string h;
sprintf(h, "OPEN '" + lbr_path + filename(a[xl]) + "';\nRUN '" + ulpFile + "';\n");
cmd += h;
}
}
}
exit (cmd);
}
else dlgMessageBox("Start this ULP from a Library", "OK");