Function Call Expressions

Function call expressions are defined using function call syntax.

Details

Details are as follows:

Examples

The following example illustrates calling a function using literal expressions as arguments. The function TestFunction calls the function AreaOfCircle, passing it a literal argument of 2.0.

double AreaOfCircle( double radius )
{
   return Math.PI() * radius * radius;
}

void TestFunction()
{
   double area = AreaOfCircle( 2.0 );
   Application.Log.LogString( area );
}

The following example illustrates calling a function using literal expressions as arguments as well as one reference argument. The function TestFunction calls the function VolumeOfCube, passing it three literal arguments and one reference argument. The volume of the cube is computed and stored in the reference argument.

void VolumeOfCube( double l, double w, double h, ref double volumeResult )
{
   volumeResult = l * w * h;
}

void TestFunction()
{
   double volume = 0.0;
   VolumeOfCube( 3.0, 4.0, 5.0, volume );
   Application.Log.LogString( volume );
}