Home Cooker Classes Others Rice CookerGX
Classes  >  element  >  InsertChild(element,int)
element class : InsertChild(element,int) method

Description

Inserts a element at the specified position by the index.

Syntax

elementInstance.InsertChild(element targetElement, int index)

Arguments

ClassNameDescription
elementtargetElementA Insert element.
intindexA insert position.

Return value

None

Sample code

//anyElement and targetElement are any instance of element type.

anyElement.InsertChild(targetElement, "0");

Notes

Index need to be "0 <= index <= number of children".

0 == index : targetElement will be inserted as first child.

0 < index < number of children : targetElement will be inserted at the specified position by the index.

index == number of children : targetElement will be inserted as last child.

Links for reference

None

Copyright © Rice All rights reserved.