Here is the starting project SquareDone.mg4 (7.2 KB) SquareDone.
I edit the function (Customize->Edit Function, Square, OK) then change the code to
square(double out, double in)
Var[out] = Var[in] * Var[in];
This code requires a bit of tech talk to explain. Don't worry if you don't understand as long as you can use the programming pattern.
MacroGen creates a global array named Var to store the measurement values. Instead of passing values we are passing array indexes. We must change how the function is called. Click Ok and edit Calc.
The current code for Calc is:
@Measure[Output].Value = square( @Measure[Input].Value );
replace it with:
square( @Measure[Output], @Measure[Input] );
The final project is SquareDone2.mg4 (7.3 KB).