---
url: /flow/guide/scripting-reference/classes/tstringlist/tstringlist.add.md
---

# TStringList.Add

## Declaration

`function Add(const S: string): Integer;`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
var MyStringList : TStringList
begin
MyStringList := TStringList.create; //create a reference to a string list object
MyStringList.Add('this is a string to add to the list'); //add a string to the list.
end;
```

## Description

Adds the given string to the end of the TStringList object. It returns the index of the newly added string.
