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

#include <vcl.h>
#pragma hdrstop

#include "SystemStrLCopy.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: SysUtilsStrLCopy
// Routine: SysUtils.StrLCopy

// BeginCode
/*
The following example uses an edit control and a button on a
form. When the button is clicked, the first X bytes of the
edit control are copied into a buffer, where X is a
predefined number.
*/
const MAX_BUFFER = 10;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  char szBuffer[MAX_BUFFER+1];
  StrLCopy(szBuffer, Edit1->Text.t_str(), MAX_BUFFER);
  Application->MessageBox(WideString(szBuffer).c_bstr(), L"StrLCopy example", MB_OKCANCEL);
}
// EndCode
// EndExample: SysUtilsStrLCopy
//---------------------------------------------------------------------------
