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

# TShortCutList.Add

Adds a shortcut with the specified text to the list.

## Declaration

Source position: actnlist.pas line 139

`public function TShortCutList.Add(`
`const S: string`
`):Integer; override;`

## Arguments

`S` |  | Text for the shortcut.

## Function result

TShortcut instance added in the method.

## Description

Add is an overridden method in TShortCutList used create and store a TShortCut instance with the specified text. It calls the inherited method on entry to store the string in S to the TStringList descendant, and to capture the position for the new value in Result. A new TShortCut instance is created using the TextToShortCut routine in the LCLProc unit. The shortcut is stored in the Object property at the position in the return value.

Use ShortCuts to access a shortcut by its ordinal position in the list.

Use IndexOfShortCut to locate a specific TShortCut class instance in the list.

## See also

TShortCutList.ShortCuts |  | Provides indexed, read-only access to the TShortCut instances in the list by their ordinal position.
TShortCutList.IndexOfShortCut |  | Gets the ordinal position in the list for the specified TShortCut class instance.
TextToShortCut |  | Converts the textual representation for a shortcut to its TShortCut value.
TStringList.Add
TStrings.Objects