//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TStringListSorted.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: TStringListSorted
// Property: Classes.TStringList.Sorted
// Method: Classes.TStrings.AddStrings

// BeginCode
/*
This example uses a list box on a form. When the application
runs, a string list object is created and three strings are
added to it. The strings are sorted and added to the list
box, where they appear in their sorted order:
*/

#include <memory>       //for STL auto_ptr class

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  std::auto_ptr<TStringList> list(new TStringList());
  list->Add("Plants");
  list->Add("Animals");
  list->Add("Minerals");
  list->Sorted = true;
  ListBox1->Items->AddStrings(list.get());
}
// EndCode
// EndExample: TStringListSorted
//---------------------------------------------------------------------------
