Skip to content

Instantly share code, notes, and snippets.

@drupalista-br
Created November 24, 2012 18:46
Show Gist options
  • Select an option

  • Save drupalista-br/4140887 to your computer and use it in GitHub Desktop.

Select an option

Save drupalista-br/4140887 to your computer and use it in GitHub Desktop.
ValidaCampos
lnCount: integer;
begin
Result := false;
for lnCount := 0 to ComponentCount - 1 do
begin
if Components[lnCount] is TLabeledEdit then
if TLabeledEdit(Components[lnCount]).Text = '' then
begin
MessageDlg('Existe campo obrigatorio em branco!', mtInformation, [mbOK], 0);
Result := true;
exit;
end
else
begin
Result := false;
end;
if Components[lnCount] is TMemo then
if TMemo(Components[lnCount]).Lines.Text = '' then
begin
MessageDlg('Existe campo obrigatorio em branco!', mtInformation, [mbOK], 0);
Result := true;
exit;
end
else
begin
Result := false;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment