Edit vazio igual a zero
boa noite, tenho um sisteminha de calcular e estou precisando fazer com que quando eu clicar no button calcular, o edit que estiver vazio tem que valer zero.
alguem pode ajudar nessa?
alguem pode ajudar nessa?
Paulo
Curtidas 0
Respostas
Carlos Bernardo
04/10/2013
if edit_x.text = emptystr then
edit_x.text := 0;
Ou
edit_x.text := 0;
Ou
procedure ZeraEdit ;
var
i : Integer;
begin
for i := 0 to ComponentCount - 1 do
if Components[i] is TCustomEdit then
begin
if (Components[i] as TCustomEdit).Text = emptystr then
(Components[i] as TCustomEdit).Text := 0;
end;
end;
GOSTEI 0