dollarSubstitute()

The function replaces dollar parameters in an expression with the parameters.

Synopsis

string dollarSubstitute(string toSubstitute, dyn_string dollarParams);

Parameters

Parameter Meaning
toSubstitute Expression to replace
dollarParams Name of the dollar parameter (for example, "$motor:motor17")

Return Value

Empty string in the event of an error, otherwise the selected expression.

Errors

Missing arguments.

Description

The function replaces dollar parameters in an expression with the parameters.

Example

In the example, the dollar parameter $motor is replaced with motor17 and motor17 starts.

main()
{
  start_motor(makeDynString("$motor:motor17"));
}
start_motor(dyn_string dollars)
{
  string dp = dollarSubstitute("$motor +
  \".start:_original.._value\"", dollars);
  dpSet(dp, true);
}

Assignment

Miscellaneous functions

Availability

CTRL