Webcore Global Variable

I want to create a webcore global variable using an expression such as @Cost_Per_KW_HR = 32.99 / 324, but when I do this I get Cost_Per_KW_HR (not set). Giving the same global variable a value such as 0.102 works fine, but I would prefer using an expression.

can you show the short example piston and full logs?

When you create a variable its a decimal string or number. So I don't think you can create a variable using an expression. If that is what you are trying to do.

You can create a variable and then set it's value with an expression, which you say works,

When you create a global variable in webcore, you are given a choice of "value" or "expression". All I'm saying is no expression is acceptable to webcore's global variable - not even a simple expression like 6/2. It has to be a bug in webcore.

Could be, I haven't done any pistons in a long time.

Confirmed that expressions don't work when editing/creating the global; however it does have a work around - after creating the global, create a quick piston to set the value using the expression.

I too found this bug. My workaround was to set a global string variable as a value not as an expression. That seemed to work.

@ipaterson - any thoughts

Are you thinking that this should be possible or that the Expression option should be removed for globals? If it were possible to assign an expression would it be evaluated at the start of each piston like a local variable expression?

Easy peasy to disable expressions there if that's the best we can do.

Here's my piston. It's still a work in progess. I am going to modify it by adding two global variables. One for monthly kw-hr and one for monthly cost. I'll do the cost per kw-hr calculation in the main code.