05 May 2016
RCML language functions can be internal or external.
Internal functions refer to the functions described in RCML language in the current file of program source code or in included files with the source code in RCML. The code of these functions is within the current program and will be compiled into an executable file of the current program.
External functions refer to the functions of RCML libraries already compiled, linked to the current program or the functions of functional modules, i.e., the code of these functions is outside the current program in RCML.
Syntactically, internal functions in RCML are called in the same manner as in other programming languages. You must first specify an identifier – the function name, and then a list of arguments given to it in parentheses:
identifier(argument1, argument2, argument3)
The result of any function call can be assigned to a variable or used in the expression. It should be noted that in the function call, all parameters specified in its description should be transferred through arguments, except for some RCML system functions.
Calling an external function has a different syntax:
source_name.function_name(argument1, argument2, argument3)
An identifier (name) of the library linked from the section of inclusions is used as the source name, or the name of the function module specified in the configuration file. Description of names and arguments of external functions can usually be found in the documentation for the respective source – the library or function module.
It should be noted that when searching for the external function, the desired source is in the first place sought among linked libraries and then among linked functional modules. If the source is found, the desired function is sought in it by name, if the function is found, the number of function parameters declared in the source is checked against the number of arguments transferred by the user. If the number of arguments and parameters is the same, it is believed that the desired function is found. In any other case, an error is issued.
RCML has system module, always available in the program and providing system functions of RCML language. If this name is specified as the source of external functions, the function is searched directly in this module, ignoring the libraries with the same name.