SBC bug? Scope rules for while construct in macros?
-
Hi!
There seem to be different scope rules for the while construct dependig if you run them in standalone or sbc.We both run RRF ver 3.3
This test snippet just tries to declare a local variable inside the loop scope (it's just an example):
var count = 0 while var.count < 3 echo "Hello world. Count: ", {var.count} var param = 42 echo "Param: ", {var.param} set var.count = {var.count + 1} ;end while
Result in a standalone setup:
2021-10-06 19:03:03 M98 P"0:/macros/test/looptest.g" Hello world. Count: 0 Param: 42 Hello world. Count: 1 Param: 42 Hello world. Count: 2 Param: 42
Result in an SBC:
10/6/2021, 1:13:48 PM M98 P"0:/macros/looptest.g" Hello world. Count: 0 Param: 42 Hello world. Count: 1 10/6/2021, 1:13:48 PM Error: variable 'var.param' already exists of looptest.g
Is this known behavior? How is it suppose to work?
-
Are local variables at all meant to be supported in SBC mode in V3.3
-
@gixxerfast thanks for reporting this. I have confirmed I see the same issue and have let @chrishamm know.
-
@gixxerfast Thanks for reporting this, I've prepared a bug fix for the upcoming software version 3.4-b5.