Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GVar... Variable GVar... Already Exists
Have been trying to figure this out for an hour or so.

Creating a GVar and setting value to time stamp that will be used again.

[Image: Screen-Shot-2019-08-12-at-22-10-57.jpg]

Above is the only place it is defined. But when I run the above, I get the error "GVar:InternetOutageStartTime is already exists..."

[Image: Screen-Shot-2019-08-12-at-22-06-02.jpg]

Where else does it exists? This is killing me.
You could always use the command:

If GlobalVars:Exists() / Not Exists() and either CreateVariable() it or SetVariable() it based on that.

My thought is, the trigger created it already, and when it gets triggered again - it is already created, and just needs to be set, not created.
There's also a SafeCreateVariable() which will create it only if it doesn't already exist. If you want to create or set a new value, then the above existence check would probably be best. Check if it's there. If so set it, else create it and set the initial value as part of the creation.
Dean Roddey
Explorans limites defectum
Oh, and, the thing to know is that the event server has a common set of global variables. The reason being so that events can pass info to each other if they need to. So they don't all go away when the event action ends. Any given action can delete any that it uses if wants.
Dean Roddey
Explorans limites defectum

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dynamically Build Call to Variable? gReatAutomation 8 1,224 05-08-2020, 01:22 PM
Last Post: gReatAutomation
  Action wait and exit if variable changes simplextech 8 1,822 02-01-2020, 12:35 PM
Last Post: simplextech
  Time formatting RunTime Time Variable? gReatAutomation 5 1,391 08-14-2019, 05:23 AM
Last Post: gReatAutomation
  Creating a Variable Double_J 13 3,352 06-22-2019, 03:40 AM
Last Post: gReatAutomation
  Variable Error in Scheduled Task znelbok 3 1,392 03-22-2019, 09:30 AM
Last Post: Dean Roddey
  Question on Formatting of Variable Text kblagron 2 2,208 09-07-2018, 08:52 PM
Last Post: kblagron
  How would I manually collect digits to enter into a variable ghurty 1 1,244 05-24-2018, 08:51 PM
Last Post: Dean Roddey
  Embedded Variable in Text zra 2 1,915 05-07-2018, 09:59 AM
Last Post: zra
  Variable Limits Syntax Shaky 6 2,700 03-03-2018, 09:47 PM
Last Post: Dean Roddey
  Passing device name as variable jokermac 12 5,578 11-18-2017, 12:38 PM
Last Post: jokermac

Forum Jump:

Users browsing this thread: 1 Guest(s)