TParamsItems (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example requires a TClientDataSet and a button on a form.

Code

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;
}}

__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
  CDS->LoadFromFile(GetCurrentDir() + L"/../CDS.XML");
  CDS->Params->CreateParam(ftInteger, "StateParam", ptInput);
  CDS->Params->CreateParam(ftInteger, "MyParam", ptInput);
}

Uses