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 |