Syntax description(3.1)

All APL functions are described according to the following:

returnType function ( type1 parameter1 , type2 parameter2 )

ParameterDescription

parameter1

A description of parameter1. If necessary, an example is given.

parameter2

A description of parameter2. If necessary, an example is given.

Returns

A description of what the function returns. If necessary, an example is given.

Example

If there is a need to explain a function in relation to other functions and/or agents, this is done in an 'Example' clause.

//Global variable declaration
int myVar1; 
 
//Function block, entry-point for execution in the Consume state.
consume { 	
	//Local varaible declaration
	string myVar2;
	
	// A comment.
	/* This is a comment over several 
	lines */

	//Assignments
	myVar1=1;
	myVar2="example";
	
	//Function call
	myFunction(myVar2);
}


//Function declaration
int myFunction(string myParam) {
	debug(myParam);
	return 0;		
}