1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/eagle-5.7.0/ulp/prevpacdescript.ulp
Eve Entropia 157fd6f1a1 eagle
2010-03-30 20:14:34 +02:00

43 lines
904 B
Text

#usage "<b>Edit previous package description</b>\n"
"<p>"
"<author>Author: support@cadsoft.de</author>"
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED
string cmd = "";
string pac[];
string edit = "";
int count = 0;
int n = 0;
if (library) library(L) {
L.packages(P) {
count++;
pac[count] = P.name;
cmd += P.name + "\n";
}
}
if (package) package(P) {
edit = P.name;
}
for (n = 1; n < count; n++) {
if (edit == pac[n]) {
break;
}
}
if (n > 1) {
cmd = "EDIT " + pac[n - 1] + ".pac;\n DESCRIPT\n" ;
// **************************************************
// a ";" must not follow DESCRIPT
// otherwise the description is overwritten
// with an empty string
// **************************************************
}
else
cmd = "EDIT " + pac[0] + ".pac;\n DESCRIPT\n" ;
exit(cmd);