File: prevpacdescript.ulp

package info (click to toggle)
eagle 4.16-5
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 36,508 kB
  • sloc: sh: 82; makefile: 32
file content (43 lines) | stat: -rw-r--r-- 904 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#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);