/*
IndexOfName, Count, Names, Values example
The following example updates the strings in a list box given the strings contained in another list box. If a string in the source list box has the form Name=Value and the destination list box contains a string with the same Name part, the Value part in the destination list box will be replaced by the source’s value.
*/ 
void MergeStrings(TStrings *Dest, TStrings *Source)
{
  for (int i = 0; i < Source->Count; i++)
  {
    if (Source->Strings[i].Pos("=") > 1)
    {
      int DI = Dest->IndexOfName(Source->Names[i]);
      if (DI > -1) 
        Dest->Values[DI] = Source->Values[i];
    }
  }
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  MergeStrings(ListBox1->Items,ListBox2->Items);
} 
