for i:=Screen.FormCount-1 downto 0 do begin if Screen.Forms[i] проверка чего-нибудь, например Caption='9' then Screen.Forms[i].Free end