EAGLE Help

Writing a ULP


A User Language Program is a plain text file which is written in a C-like syntax. User Language Programs use the extension .ULP. You can create a ULP file with any text editor (provided it does not insert any additional control characters into the file) or you can use the builtin text editor.

A User Language Program consists of two major items, definitions and statements.

Definitions are used to define constants, variables and functions to be used by statements.

A simple ULP could look like this:

// Definitions:
string hello = "Hello";
int count(string s)
{
  int c = 0;
  for (int i = 0; s[i]; ++i)
      c += s[i];
  return c;
}
// Statements:
output("sample") {
  printf("Count is: %d\n", count(hello));
  }

Index Copyright © 1999 CadSoft Computer GmbH