The data from the OS may be passed to the RCML program via the command line. However, at this stage of language development only real data types may be passed. In order to have access to the parameters in the RCML code passed via the command line, add necessary parameters to the main function.

The values are passed to these parameters of the main function by adding the parameter value to the invocation command of the RCML interpreter after specifying the file with the PC code. Passing a parameter with a value will be as follows:

-Pparameter_name=parameter value

For example, let there be a test.rcml file with the following content:

function main(foo, bar) {
	sum = foo + bar;
	system.echo(“foo + bar = ”, sum, “\n”);

The command for compiling the RCML file:

rcml_compiler test.rcml test.pc

The command for executing the RCML program with passing value 1 to parameter foo, and bar equal to 3.5:

rcml_interpreter test –Pfoo=1 –Pbar=3.5

The result of program execution will be:

foo + bar = 4.5

Here, the order of passing the parameters values is not important, since they are passed by their names. The parameters whose values have not been passed will be equal to 0.0. 

In the next example:

rcml_interpreter test –Pfoo=1

The result will be:

foo + bar = 1

If the value has been passed for a non-existing parameter, an error will be thrown at the attempt to run the RCML program.

The following example contains an error, since the err parameter does not exist:

rcml_interpreter test –Pfoo=1 –Perr=2.35