tumblr tracker

Calling a Function from the library

Parent Previous Next

Calling a Function from the library


Moscripto has a ready-made library of functions divided in namespaces for easier segregation. To call a function you first have to type the namespace name, then dot (.) and then the function name and any parameters that the function needs within brackets and comma separated and optionally semicolon terminated:


Namespace.FunctionName(param1,param2 etc);


eg:


$val = String.Trim("  John Doe   ");


Function calls can be nested:


Namespace.FunctionName1(Namespace.FunctionName2(), Namespace.FunctionName3())


eg:


$val = String.Replace(String.Trim($a), String.Trim($b));


thus making combining function results much easier.