[Overview][Classes][Index] | Reference for unit 'resourcetree' (#fcl-res)

# TResourceTreeNode.CreateResource

Creates a new resource

## Declaration

Source position: resourcetree.pp line 52

`public function TResourceTreeNode.CreateResource: TAbstractResource; virtual;`

## Function result

The newly created resource

## Description

This method creates a new resource.

A new resource is created and its type, name and language id are determined from the ancestor nodes in the tree hierarchy.

Usually CreateResource is called by resource readers that read files in which resources are stored as trees.

Remark: | This method is meaningful only when called on leaf nodes (language id nodes).

## See also

TResourceTreeNode.IsLeaf |  | Reports whether the node is a leaf node.