Function call

Function calls look similar to function definitions. For example, you define this function:

int Sqr(int x)
{ 
	return x * x; 
}

You can call it in another function such as:

void Calculate()
{ 
	int result = Sqr(4); 
}

When calling functions BI# tries to determine the target function through its name and the argument types. If the argument types do not match exactly, BI# tries to find a matching function by converting the arguments. If you define this function, for example:

double Sqr(double x)
{ 
	return x * x; 
}

You can call it with an int argument and BI# converts it to a double automatically:

void Calculate()
{ 
	double result = Sqr(4); 
}

BI# provides a variation of function calls. The cached keyword can be applied to functions that potentially cache their results. This can speed up your processes tremendously. For example, the OLAPGetElementList() function can cache its results. It performs real work only at the first call of the function. For all subsequent function calls it can return the cached results:

void Process(OLAPConnection connection)
{ 
	OLAPElementList result = cached OLAPGetElementList(
		connection,
		"dimension1",
		true
	); 
}

At the moment you can apply the cached keyword to these functions:

  • OLAPGetElementList
  • OLAPCellReadNumber
  • OLAPCellReadString
  • OLAPGetStringAttribute
  • OLAPGetIntAttribute
  • OLAPGetDoubleAttribute
  • OLAPGetChildElementList
  • OLAPCellReadComment