Quote:
|
Originally Posted by Novo
How about this?
PHP Code:
function onCreated()
{
temp.rank = createSubObject( gang_Test, "rank." );
}
function createSubObject( obj, strPart )
{
temp.oobj = new TStaticVar();
temp.vars = getObjKeys( obj, strPart );
for ( temp.var: temp.vars )
makevar( "temp.oobj."@ temp.var ) = makevar( "obj.rank."@ temp.var );
return temp.oobj;
}
public function getObjKeys( obj, strNeedle )
{
if ( obj.type() != 2 )
return getstringkeys( obj );
temp.vars = obj.savevarstoarray( false );
for ( temp.var: temp.vars )
if ( temp.var.starts( strNeedle ) )
temp.keys.add( temp.var.substring( strNeedle.length(), temp.var.pos("=") - strNeedle.length()) );
return temp.keys;
}
|
w-hat? If you're going to use spaces in your style, atleast be consistant with it. But anyways:
If that 'getObjKeys' function is what I think it is, it's redundant. You can just use this.objectname.getvarnames() to return an array with the list of members in it.