{
This code fragment moves any nonvisual components on the 
form into a separate data module. Note that the components 
are removed starting with the last component, so that the 
unprocessed portion of the Components array does not change.
Note: This code does not save the form or data module to 
disk after the nonvisual components are moved.  If executed 
at runtime, the effect will not persist.
} 
var
  I: Integer;
  Temp: TComponent;
begin
  for I := ComponentCount - 1 downto 0 do
  begin
    Temp := Components[I];
    if not (Temp is TControl) then
    begin
      RemoveComponent(Temp);
      DataModule2.InsertComponent(Temp);
    end;
  end;
end; 

