What is "gBrewStatus"? You need to keep everything in context. If you had an object, and you wanted to perform an action to it, they need to match. For example, if your object was "school" and your action was "eat" - this wouldn't work as you can't eat a school. But if your object were "apple", then it would make sense. In this case, this may be a particular element (we don't know what it is because you didn't say) which does not allow math to take place on it.
You got lost in the trees and did not see the forest.
new value gBS
gBS = "gBrewStatus" value
gBS += 1
"gBrewStatus" value = gBS
delete gBS
works but
"gBrewStatus" value += 1
throw an error!
Why does not the "gBrewStatus" value += 1 work?
gBrewStatus is a global element type value.
bBrewStatus is simply a global element value that is incrementally advance +1 when a switch (AllSwitch) is clicked and sometimes by a timer or temperature. I use a wait statement to advance my brew day script based on the value of gBrewStatus. it allows me to jump into the brew day script where I want when testing. It is simply something for my own use and may have no value to someone else. Just a different way to skin the cat.
in a running script
//gBrewStatus is a global value type element that is hidden. When testing it is visible allowing me to incrementally jump by manually changing the value similar to the Step in the Script Window, except that I can see the whole screen and not have the script pane open or by simply clicking the "AllSwitch"
if "AllSwitch" == true
new value gBS
gBS = "gBrewStatus" value
gBS += 1
"gBrewStatus" value = gBS
delete gBS
"AllSwitch" =false
end if
I can use the "AllSwitch" Switch Element to control the flow of my Brew Script regardless of where I am. I have a different global that serves as the Label for the switch. "AllSwitchDisplay" that is a string type global.
wait gBrewStatus == 1
//write some code to do something
wait gBrewStatus == 2
//jump here after "AllSwitch" is clicked and gBrewStatus is now 2
//write some code to do something
//wait on a Temp
if "MLT Temperature" value <= "Strike Setpoint" value
gBrewStatus = 3
wait gBrewStatus == 3
//write some code to do something like add grain
I find it very helpful when testing long scripts.
And I might want to eat the School. Just depends. I like thinking outside the box.