Announcement

Collapse
No announcement yet.

Can Global VARs of same name interfere in a chart?

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

  • Can Global VARs of same name interfere in a chart?

    I have now two situations where it appears that if two efs files are runing on the same chart, and they have global variables of the same name, those values are shared.

    Is it true that the globals on a chart are visible throughout all efs functions running on that chart?
    Last edited by jgr; 07-31-2009, 11:34 AM.

  • #2
    I'm pretty darn sure this is NOT the case in EFS.

    In each efs, you can have similar (the same) variables for each efs you use. If you set x = 0 in one and x = 5 in the other, they are separate "instances" of x thru the scripting engine.

    Each efs is it's own instance on the chart. So if you load the same efs over and over on a chart, they operate as unique instances on the chart.

    Hope this makes sense to you??

    On the other hand, if you create "system wide global variables" with setGlobalValue() and getGlobalValue(), then these you have manage on your own. They are true GLOBAL VARIABLES (spanning all charts).

    If you need more help, just ask?
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Well I have a bizarre situation. I had an indicator, which I had programmed, running on a chart. (no variables specifically defined as Global). Then I started getting serial alerts occuring so frequently that clearly there was some code problem. Then I discovered that I had two of the same efs (differnent versions slightly) installed. I Removed one of them.

      I continued to get spurious alerts from another indicator on the same chart. I removed that one too. Still spurious alerts. I removed all the indicators from that chart. Still spurious alerts. I closed the chart. Then they stopped. I reopened the chart and installed the one indictor and that is fine.

      So, something really went astray there. The fact that I could remove the indicators and still have alerts being generated tells me that some code remains with the chart. Or, else I discovered an obscure bug.

      My first thought was that the global variables were getting mixed up in the efs engine.

      Comment

      Working...
      X