• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Control a single bool from many indicators

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Control a single bool from many indicators

    Hi,

    I want to be able to control the state of a single bool from many instances of the same indicator. Call it a master bool that all indicator instances can read. Is this possible?

    To explain my logic, for example lets say I have 20 instances of the same indicator running at the the same time and each them may randomly fire off an audio alert at any time. I want a master switch for turning off audio alerts for all the indicator instances at once without having to mute my whole computer sound.

    I could have the indicator read a text file to get the bool val and then just change the text in the txt file to control this as a master but I was hoping for a less cumbersome solution.

    Thanks in advance for any help.

    #2
    static int?

    What I use it for:

    Increment a static int upon creation, and decrement it upon object destruction.

    Should give you total object count.


    Code:
    public static int obj_ct = 0;

    so if you set it - it's good across all instances...

    so turn on/off and everyone else should see the same variable.

    Comment


      #3
      Brilliant. For some reason I thought the Static var value once changed wouldn't transfer to the non-static vars represented in the properties section in the other instances... but it does perfectly. Too easy.

      Thank you sledge.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Debayan Sen, Today, 01:50 AM
      0 responses
      1 view
      0 likes
      Last Post Debayan Sen  
      Started by eleven, Yesterday, 10:03 PM
      1 response
      9 views
      0 likes
      Last Post eleven
      by eleven
       
      Started by tvbecv, Yesterday, 09:23 PM
      0 responses
      8 views
      0 likes
      Last Post tvbecv
      by tvbecv
       
      Started by reedstickets, Yesterday, 08:07 PM
      0 responses
      8 views
      0 likes
      Last Post reedstickets  
      Started by timko, Yesterday, 07:39 PM
      0 responses
      5 views
      0 likes
      Last Post timko
      by timko
       
      Working...
      X