Set variable and super variable?


#1

I have A question about variable and super variable
with a normal one and set a value you get @myvar= 0; but if you do same thing on super one it shows not set if you use 0


#2

When you say “super variable” do you mean “global variable”? You can set a global variable to 0. Here’s an example. This piston changed my global variable test from 10 to 0.


#3

I mean one with a @@


if i click add it will say not set


#4

What variables have @@ in front of them?


#5

a super variable has two @@ if i do what the image above shows an click add it it wiil show not set


#6

Give me an example of a supervariable. I’ve never heard of them in reference to Webcore.


#7

Variables that are supposed to work across locations but not sure if fully implemented.


#8

So, if you’re not running multiple locations, there is no need for “Super Variables”, right?


#9

Yep, I only have one location, never had the chance to try it out :slight_smile:


#10

@beau76
It looks to me like if the variable type is “number (decimal)” or “number (integer)” it doesn’t set propoerly. Set the variable type to “dynamic” and it seems to work. At least it will set - no idea if it actually will work as a super global.

image


#11

I am using a super because i have two instances of web core one is just for tiles


#12

Maybe I am just old school, but I learned a long time ago to never intentionally use 0 in variables.
(since some coding sees zeros as null or not set etc)

Tradition teaches us 0 = off and 1 = on… but I find coding is more reliable when 1 = off and 2 = on.


#13

Hi Wcmore,
keep the idea in mind of never using 0
lets say you have a decimal variable you went to reset before every use how do yo do it ?
Thanks


#14

Now that I think about it, I don’t know if I have ever reset a variable in webCoRE except during my testing phase… In those cases, I would pick a decimal that would not ever come up naturally.

For example, if it was the temperature, I may reset it by using:
Set variable temp = 111.1
or some other number that would never be the real temperature.