int swOpen = 0; ... void __fastcall TForm1::Timer1Timer(TObject *Sender) { ... if (cont == 270 && !swOpen) { swOpen = 1; ... } ...