#usage "Edit next library in current directory\n"
       "
"
       "Author: support@cadsoft.de"
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED
if  (library) {
   library(L) {
      string a[], cmd;
      string Lname = L.name;
      string lbr_path = filedir(L.name);
      int n = fileglob(a, lbr_path + "*.lbr");
      if (n) {
         for (int xl = 0; xl < n; xl++) {
            if (Lname == a[xl]) {
               if (xl < n-1) {
                  string h;
                  sprintf(h, "OPEN '" + a[xl + 1] + "';");
                  cmd += h;
                  exit (cmd);
                  }
               }
            }
         }
      }
   exit (0);
   }
else dlgMessageBox("Start this ULP from a Library", "OK");