Simdify Scripting Language supports importing libraries that implement common functionality.
Details are as follows:
This example declares a library in a Simdify Scripting Language file named LIB_MATH_UTIL.SSL:
// This declares a library named 'LibMath'.
library LibMath;
function double CalculateArea( double p_dLength, double p_dWidth )
{
double a_dArea = p_dLength * p_dWidth;
return a_aArea;
}
This example imports the LibMath library and uses the function:
import library "lib_math_util.ssl";
double a_dLength = 5.0;
double a_dWidth = 7.0;
double a_dArea;
// Access the function using the library name and the '.' operator.
double a_dArea = LibMath.CalculateArea( a_dLength, a_dWidth );
This example imports several libraries.
// This library is in the same folder as the importer.
import library "application_util.ssl";
// This library is also in the same folder as the importer.
import library "c:\\release6\\simdify\\scripts\\graph_util.ssl";
// This library is in a different folder than the importer.
import library "..\\scripts\\opengl_util.ssl";