APPENDIXC

Images
User-Language Program Reference

Although the user-language program (ULP) language is C-like, it is not exactly C. For example, the equivalent to the C “float” type is called “real” and there is no “boolean” type. This appendix gives a summary of the ULP language, in particular where it differs from the C syntax.

You will find information on using ULPs in Chapter 10. You will also find the built-in help files of EAGLE (accessible from the Help menu) useful.

Images

Data Types

The following primitive types are defined.

Images

Images

Strings

The “string” data type is more like a Java “string” class than a C character array. You can concatenate strings using the + operator and also use a number of built-in functions to manipulate strings.

Images

Images

Arrays

Arrays use the same [ ] syntax as C, but can be created dynamically from built-in functions, as the example below of splitting a string into a string array illustrates.

Images

Images

Logical and Bitwise Operators

These are the same as C. So, bitwise “and” and “or” are “&” and “|” respectively. Logical equivalents are: “&&” and “||”. The not operator is “!” and xor id “^”.

Images

Control Structures

These are the same as C. You have access to the usual control structure commands such as “if”, “while”, “for”, “break”, etc.

Images

Special Constants

A number of EAGLE specific constants are defined for the ULP.

Images

Images

Dialog Functions

The ULP language includes a number of built-in dialog types that you can use in your programs.

       dlgDirectory—Prompts for a directory from the file system and returns the path

       dlgFileOpen—Prompts for a file to open and returns the file path

       dlgMessageBox—Displays a message to the user

See the online help for the full syntax for these commands.

Images

Other Built-in Functions

There are many other built-in functions available in the ULP language, for tasks such as reading and writing files, performing HTTP requests, and even manipulating XML. See the online documentation for these functions in the built-in help system.