Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GVar... Variable GVar... Already Exists
#1
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.
Reply
#2
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.
Reply
#3
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
Reply
#4
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Action wait and exit if variable changes simplextech 8 449 02-01-2020, 12:35 PM
Last Post: simplextech
  Time formatting RunTime Time Variable? gReatAutomation 5 537 08-14-2019, 05:23 AM
Last Post: gReatAutomation
  Creating a Variable Double_J 13 2,026 06-22-2019, 03:40 AM
Last Post: gReatAutomation
  Variable Error in Scheduled Task znelbok 3 772 03-22-2019, 09:30 AM
Last Post: Dean Roddey
  Question on Formatting of Variable Text kblagron 2 1,475 09-07-2018, 08:52 PM
Last Post: kblagron
  How would I manually collect digits to enter into a variable ghurty 1 898 05-24-2018, 08:51 PM
Last Post: Dean Roddey
  Embedded Variable in Text zra 2 1,313 05-07-2018, 09:59 AM
Last Post: zra
  Variable Limits Syntax Shaky 6 2,076 03-03-2018, 09:47 PM
Last Post: Dean Roddey
  Passing device name as variable jokermac 12 4,478 11-18-2017, 12:38 PM
Last Post: jokermac
  Variable Driver Trigger Error zra 4 3,237 07-06-2017, 01:00 PM
Last Post: zra

Forum Jump:


Users browsing this thread: 1 Guest(s)