Announcement

Collapse
No announcement yet.

Using efsInternal inside efsLib

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using efsInternal inside efsLib

    Is using an efsInternal call inside a function in an efsLib allowed?

    I have a function in a library which is called from main(), and in that function I use efsInternal to call another function within the same library to generate a series.

    The code gets to the line with the efsInternal call on it and then just exits without any exceptions or errors being generated.

    I put a try/catch block around the efsInternal call and didn't get any exceptions.

    I can put debugPrintln's before and after the call. The one before is hit, but the one after isn't.

    Thanks,

    Steve

  • #2
    Hello Steve,

    Yes, you should be able to use efsInternal() inside a function library file. Please post a code example that illustrates the problem and I'll investigate.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Hi Jason,

      I'm having the same/similar problem. In the following code I don't understand why mySeries2 always prints a "null". mySeries2 is created the same way as mySeries1 except that it is created inside of a library. Any help would be appreciated. Thanks.

      Jeff

      test.efsLib
      Code:
      function createSeries2()
      {
          return efsInternal("foo2");
      }
      
      function foo2()
      {
          return 2;
      }
      Test.efs
      Code:
      var myLib = null;
      var mySeries1 = null;
      var mySeries2 = null;
      var fullyInitialized = false;
      
      function main()
      {
          if (!fullyInitialized)
          {
              if (myLib == null)
                  myLib = addLibrary("test.efsLib");
              if (mySeries1 == null)
                  mySeries1 = efsInternal("createSeries1");
              if (mySeries2 == null)
                  mySeries2 = myLib.createSeries2();
              fullyInitialized = true;
          }
      
          if (getCurrentBarIndex() == -10)
          {
              debugPrintln("mySeries1 at -10 = " + mySeries1.getValue(0));
              debugPrintln("mySeries2 at -10 = " + mySeries2.getValue(0));
          }
      
          return 0;
      }
      
      function createSeries1()
      {
          return efsInternal("foo1");
      }
      
      function foo1()
      {
          return 1;
      }

      Comment


      • #4
        Hello Jeff,

        The addLibrary() call needs to be performed in the global scope outside of main(). Please give that a try.
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment

        Working...
        X