Helma logo
helma.org » Home > Stories > HopObject.add()

HopObject.add()

Adds a HopObject as new subnode to another HopObject.

The new subnode is added after the last subnode already contained in the parent HopObject.

Syntax
HopObject.add(HopObject)

Example
res.write(root.size());
0
var myStory= new story();
root.add(myStory);
res.write(root.size());
1


It is also possible to add a bunch of subnodes with only one function call:
var myAuthor= new author();
var myBook = new book();
var myStory= new story();
root.add(myAuthor, myBook, myStory);
res.write(root.size());
3


... comment


Page last modified on 2002-07-16 13:06 by tobi