V5 Wish List

 From:  Michael Gibson
10114.449 In reply to 10114.448 
Hi Larry, I've updated a couple of scripting things for the next v5 beta to help with that.

The first thing is that all MoI script objects implement a .toString() function that will return the specific object name rather than a generic "MoiObj" name which used to be returned for every object previously.

So for example this:

var obj = moi.geometryDatabase.createObjectList();
var text = obj.toString();

will now generate [object ObjectList] instead of [object MoiObj].


Then the other thing is that property enumeration using the "for...in" syntax will now work on MoI script objects which wasn't implemented previously. Methods will also show up in the enumeration as properties that have a value of '[object Function]'.


So that should enable making a dump function like you're asking about, something like:

code:
function dump( obj )
{
    var text = obj.toString();

    for ( propname in obj )
        text += '\n' + propname + '=' + obj[propname].toString();

    return text;
}


- Michael