Pongo una nueva función que me parece interesante y empezare a usar, en el tutorial, que por cierto me llevara unos días seguir publicando, ya que quiero terminar el módulo de documentos.
Código Delphi
[-]function CamposObligatorios(DS:TDataSource; NoField:string=''):Boolean;
var j:Byte;
Msg:String;
begin
Msg:='';
Result:=False;
with DS.DataSet do
begin
for j:=0 to FieldCount -1 do
if ((Fields[j].Required) and (Fields[j].AsString = '')) and (Fields[j].FieldName<>NoField) then
begin
if Msg <> '' then Msg:=Msg+' - ';
Msg:=Msg+Fields[j].FieldName;
end;
end;
if Msg <> '' then ShowMessage('Atención, el/los campo/s :'+ #13+Msg+' No contiene datos')
else Result:=True;
end;