title: Check if component is either type
body: <p>I am trying to check if a component is type <code>TMachine</code> or <code>TLabel</code>  if so i want it to free it as long as its NOT Label1 or label2</p>
  
  <p>but it will not let me do an <code>OR</code>  on <code>if Components[I] is (TMachine) or (TLabel) then</code> Any way to fix this?</p>
  
  <pre><code>    procedure TfDeptLayout.FormClose(Sender: TObject; var Action: TCloseAction);
  var
    I: Integer;
  begin
       for I := ComponentCount -1 downto 0 do
        begin
            if Components[I] is (TMachine) or (TLabel) then
                if Components[I].Name &lt;&gt; Label2.Name then
                  if Components[I].Name &lt;&gt; label3.Name then
                    components[I].Free;
        end;
  end;
  </code></pre>