Colobot Wiki
Advertisement

Returns from a function.

Syntax:

void function ( )
{
	return;
}

For specialists[]

If the function has a return type, the return instruction must be followed by the value to be returned:

float Pi ( )
{
	return 3.1415;
}
float Mean (float a, float b)
{
	return (a+b)/2;
}
string Sign (float a)
{
	if ( a > 0 )  return "positive";
	if ( a < 0 )  return "negative";
	return "null";
}
Advertisement