window.arrsize = function(a){
    if(Array.isArray(a))
        return a.length;
    if(a == null)
        return 0;
    if(typeof a == "object")
        return Object.keys(a).length;
    if(a === undefined)
        return 0;
    if(typeof a === "string")
        return arrsize(State.getVar("$"+a));
    console.error("Unsuported Parameter for ARRSIZE:",a);

}

window.ARRSIZE = window.arrsize;
