EAGLE Help

device()


Function
Opens a device context.

Syntax
device(identifier) statement

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

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

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

See also package, symbol, library

Check if there is a device

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

Example

if (device)
   device(D) {
     D.gates(G)
       printf("Gate: %s\n", G.name);
     }

Index Copyright © 1999 CadSoft Computer GmbH