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

#include <vcl.h>
#pragma hdrstop

#include "TParamsItems.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: TParamsItems
// Property: DB.TParams.Items
// Property: Classes.TCollection.Count
// Property: DB.TParam.DataType
// Property: DB.TParam.IsNull
// Property: DB.TParam.AsInteger

// BeginCode
/*
This example requires a TClientDataSet and a button on a form.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int I = 0; I < CDS->Params->Count; I++)
{
  if (CDS->Params->Items[I]->IsNull &&
	  CDS->Params->Items[I]->DataType == ftInteger)
	CDS->Params->Items[I]->AsInteger = -1;
}}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  CDS->LoadFromFile(GetCurrentDir() + L"/../CDS.XML");
  CDS->Params->CreateParam(ftInteger, "StateParam", ptInput);
  CDS->Params->CreateParam(ftInteger, "MyParam", ptInput);
}
// EndCode
// EndExample: TParamsItems
//---------------------------------------------------------------------------

