Announcement

Collapse
No announcement yet.

Arrays in objects

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

  • Arrays in objects

    -- Edit Notes - Alex pointed out I made some transcription errors in my object names --



    I seem to be missing something here...why doesn't this seem to work?

    var MyObj = new Object;

    MyObj.X = 1;
    MyObj.Y = 2;
    MyObj.Array = new Array();

    MyObj.Array.push (3);
    MyObj.Array.push (4);

    debugPrintln ("X = " + MyObj.X + " Y= " + MyObj.Y + " Array Length = " + MyObj.Array.length);


    The above produces "NaN" for the println.


    Thanks,

    Garth
    Last edited by gspiker; 03-30-2009, 08:38 PM.
    Garth

  • #2
    Re: Arrays in objects

    Garth
    FWIW this is the result I am getting at my end
    Alex




    Originally posted by gspiker
    -- Edit Notes - Alex pointed out I made some transcription errors in my object names --



    I seem to be missing something here...why doesn't this seem to work?

    var MyObj = new Object;

    MyObj.X = 1;
    MyObj.Y = 2;
    MyObj.Array = new Array();

    MyObj.Array.push (3);
    MyObj.Array.push (4);

    debugPrintln ("X = " + MyObj.X + " Y= " + MyObj.Y + " Array Length = " + MyObj.Array.length);


    The above produces "NaN" for the println.


    Thanks,

    Garth

    Comment


    • #3
      Thanks Alex. That is the results I'm looking for but not getting.

      What version of eSignal are you running?

      In the mean time, I will verify I haven't done something stupid with my object names in my real code...

      Garth
      Garth

      Comment


      • #4
        Garth
        Version 10.4 build 1540
        Alex

        Edit after post: I also tested it on version 8 and it is returning the same result



        Originally posted by gspiker
        Thanks Alex. That is the results I'm looking for but not getting.

        What version of eSignal are you running?

        In the mean time, I will verify I haven't done something stupid with my object names in my real code...

        Garth

        Comment

        Working...
        X