Variable Passing - TobCar/carla GitHub Wiki

Variable passing is done by passing the actual instance of an object with the keywords “using” and “passing”. The exact syntax for how to use them depends on whether they are being used in a process or an Orderable.

The "using" and "passing" keywords are optional if the process doesn't need any variables passed to it or it doesn't pass any variables to the process that called it.

It is possible to have more variables for each of the keywords as long as they are separated by commas. There can also be multiple "using" and "passing" keywords for one process. Their variables are processed the same way as if they were all on the same line separated by commas.

How Passed Variables Are Treated

Variables passed to a process can then be passed to Orderables in that process through the "using" keyword.

When a variable is passed to a step it can use that variable in its code as if it had already been initialized. That is, the variable should not be declared again with "var" or "val" since the compiler will generate that line.

How To Pass A Variable

When in a step: there must be a variable with the same name as the passing keyword expects.

When in a process: a step in the process needs to pass a variable with the same name as the process's passing keyword expects.