Function Definitions

You can write your own User Language functions and call them just like the Builtin Functions.

The general syntax of a function definition is

type identifier(parameters)
where type is one of the data or object types, identifier is the name of the function, parameters is a list of comma separated parameter definitions, and statements is a sequence of statements.

Functions that do not return a value have the type void.

A function must be defined before it can be called, and function calls can not be recursive (a function cannot call itself).

The statements in the function body may modify the values of the parameters, but this will not have any effect on the arguments of the function call.

Execution of a function can be terminated by the return statement. Without any return statement the function body is executed until it's closing brace (}).

A call to the exit() function will terminate the entire User Language Program.

The special function main()

If your User Language Program contains a function called main(), that function will be explicitly called as the main function, and it's return value will be the return value of the program.

Command line arguments are available to the program through the global Builtin Variables argc and argv.


int CountDots(string s)
  int dots = 0;
  for (int i = 0; s[i]; ++i)
      if (s[i] == '.')
  return dots;
string dotted = "This.has.dots...";
output("test") {
  printf("Number of dots: %d\n",

Index Copyright © 2005 CadSoft Computer GmbH