sales@scenomics.com +1 650 396 9674

Libraries

Scenome Scripting Language supports importing libraries that implement common functionality.

Details

Details are as follows:

  • Libraries can only be imported once in a particular script file.
  • Libraries must be imported directly.
  • Circular references are prohibited.

Examples

This example declares a library in a Scenome 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\\scenome\\scripts\\graph_util.ssl";

// This library is in a different folder than the importer.
import library "..\\scripts\\opengl_util.ssl";