[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'ActnList' (#lcl)

# TCustomActionList.ActionByName

Returns an action identified by its name.

## Declaration

Source position: actnlist.pas line 106

`public function TCustomActionList.ActionByName(`
`const ActionName: string`
`):TContainedAction;`

## Arguments

`ActionName` |  | Name of the action to locate in the Actions property.

## Function result

Action with the specified name, or Nil when not found in Actions.

## Description

ActionByName is a TContainedAction function used to retrieve an action from the list with the name specified in the ActionName argument. ActionByName calls IndexOfName to get the position for the specified action name.

The return value is the TContainedAction instance found with the given name, or Nil when the name is not located in Actions.

Use GetEnumerator to get an enumerator used to visit all of the values in the Actions property.

Use ActionCount and Actions to access actions in the list by their ordinal position.

## See also

TCustomActionList.Actions |  | Provides indexed access to actions in the list by their ordinal position.
TCustomActionList.ActionCount |  | The total number of actions in the action list.
TCustomActionList.GetEnumerator |  | Gets an enumerator for actions in the action list.
TCustomActionList.IndexOfName |  | Gets the ordinal position for the action with the specified name.
TContainedAction |  | Implements an Action class which has a category and parent action list.