Announcement

Collapse
No announcement yet.

var NameArray = new Array(99);

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

  • var NameArray = new Array(99);

    When I change the subject line to

    var aArray = new Array(999);

    esignal crashes immediatly.

    The array currently has about 10 items, so 99 will work.

    I increased the heap size and stack size by an order of magnitude.

    Should I do something else?

  • #2
    Dave,

    When dealing with similar issues with global variables, I managed this two seperate ways.

    the first being that I split it into 10 separate arrays (you may even try a 10 x 100 array)

    The second is that I used toFixed(4)*1 after the variables. Since eSignal is locking up when you are only declaring the array, maybe it is reserving excessive space for the array. Try this initiation routine and see if it works.

    PHP Code:
    function Initialize_1X_Array(n1){//initialize 1 dim array
        
    var i;
        var 
    nArray = new Array();
        if (
    n1 == null){n1 =2;}
        for (
    0;n1i++){nArray[i] = 0;}
        return 
    nArray;

    Comment


    • #3
      Hello David,

      Setting an array to a size of 999 shouldn't be a problem by itself. There must me some logic in your formula that is being adversly affected by the 999 size. If you post your code I'll take a look and see if I can help figure out the problem. If you don't want to post your code I suggest adding a return statement towards the top of main(). Save and run your formula and see if the crash still occurs. If it doesn't, then start moving that return statement down through your formula systematically until you encounter the crash again. That will help you narrow down the line of code causing the crash.

      Are you passing the aArray to a debugPrintln() statement by chance? That could be the culprit.
      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