Array Out Of Bounds Error - How to check if there are History objects?

Hi

i try to read the activity history with:
var acthis = ActivityMonitor.getHistory();
var his0_goal = acthis[0].stepGoal;
var his0_steps = acthis[0].steps;
var his1_goal = acthis[1].stepGoal;
var his1_steps = acthis[1].steps;


If there is a history, everything works fine. But if not i get an
"Array Out Of Bounds Error" - Error.

How can i check if the history array contains "n" objects?


Sorry for this stupid basic question, its quite a long time ago since i wrote some kind of code ;-)
Thanks
Achim
  • as usual...

    searching 15 minutes for a solution... writing a post ... searching another 30 seconds ...finding the solution.

    for(var i = 0; i < acthis.size(); i ++)
    {
    Sys.println(i);
    }



    array.size() works fine.