Announcement

Collapse
No announcement yet.

efsExternal confusion

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

  • efsExternal confusion

    can someone please help me understand how the following code should look for it to work? I have used the examples given in the efs reference but I am too much of an idiot to get it to work!

    obviously d3 should equal 1, not null!

    =========RUNNING SCRIPT===============

    function main(){

    var aDaily;

    aDaily = efsExternal( "/CUSTOM/iDaily.efs");
    var d1 = getSeries( aDaily, 0 );
    var d2 = getSeries( aDaily, 1 );
    var d3 = getSeries( aDaily, 2 );
    var d4 = getSeries( aDaily, 3 );
    var d5 = getSeries( aDaily, 4 );
    var d6 = getSeries( aDaily, 5 );
    var d7 = getSeries( aDaily, 6 );
    debugPrint("d3= "+d3);

    }


    ==========CALLED efsExternal "iDaily.efs"=======


    function main(){


    dA=1;
    dB=1;
    dC=1;
    dD=1;
    dE=1;
    dF=1;
    dG=1;

    return (
    dA,
    dB,
    dC,
    dD,
    dE,
    dF,
    dG
    );
    }

    ============ formula output window:

    d3= null

  • #2
    mitboy,

    A couple of things.
    In main the efsExternal call should only be done once. So in main add something like:

    if(!bInit){
    aDaily = efsExternal("/CUSTOM/iDaily.efs");
    bInit = true;
    }


    Also add outside of main:
    var bInit = false;

    Your return from the iDaily.efs should be
    return new Array(dA, dB, dC, dD, dE, dF, dG);

    Let us know if that worked.

    Steve

    Comment


    • #3
      Thanks again Steve - perfect!
      I appreciate you taking the time to help me out,
      Cheers,
      mitboy

      Comment

      Working...
      X