EAGLE Help

package()


Function
Opens a package context.

Syntax
package(identifier) statement

Description
The package statement opens a package context if the current editor window contains a package drawing. A variable of type UL_PACKAGE is created and is given the name indicated by identifier.

Once the package context is successfully opened and a package variable has been created, the statement is executed. Within the scope of the statement the package variable can be accessed to retrieve further data from the package.

If the current editor window does not contain a package drawing, an error message is given and the ULP is terminated.

See also library, deviceset, symbol

Check if there is a package

By using the package statement without an argument you can check if the current editor window contains a package drawing. In that case, package behaves like an integer constant, returning 1 if there is a package drawing in the current editor window, and 0 otherwise.

Example

if (package)
   package(P) {
     P.contacts(C)
       printf("Contact: %s\n", C.name);
     }

Index Copyright © 2005 CadSoft Computer GmbH