File: ex-argv-path.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 (17 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#usage "<b>Example: Usage of argv</b>\n"
       "<p>"
       "Returns the path of the ULP."
       "<p>"
       "<author>Author: support@cadsoft.de</author>"

// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED

void main(void) {
   string ulp_path = "";
   char c = '/';
   int pos = strrchr(argv[0], c);
   if (pos >= 0) {
      ulp_path = strsub(argv[0], 0, pos + 1);
   }
   dlgMessageBox(ulp_path , "+OK");
}