I developed a small application in Delphi with TEdit components on it.
I used this function to validate if the component fields are not empty.
function TF_config.Validatefields:boolean;
var
i : integer;
begin
for i := 0 to ComponentCount - 1 do
begin
if (Components[i]is TEdit) then
begin
if ((TEdit(Components[i]).Text) ='') then
begin
MessageDlg('Enter data in all the fields',mtWarning,[MBOK],0);
TEdit(Components[i]).SetFocus;
result := false;
exit;
end;
end; //end for TEdit
end; //end component count
result := true;
end;
Now I have to add one more component

The order in which the function checks for data if valid is
ID->Name->Address->Phone->Age. But I want it to be ID->Name->Address->Age->Phone.
I tried solving it deleting the Phone Edit component and later add it after adding the Age Edit component.Or using the Phone Edit component for Age and add new Edit component for Phone. This is easier for few components, but becomes tedious when having many of them.
So I was wondering if we could arrange the components in a manner that suits us. Is this possible?
I would suggest putting the controls in your own list/array, then you have full control over its content and ordering, and can loop through it when needed. This also ensures that you touch only the controls you are actually interested in and not wasting time touching other controls that you are not interested in, and it also allows the VCL to maintain its own ordering of its own internal lists as it sees fit.
Update: If you have multiple types of controls that you need to validate, you can do this instead: