: delphi-br@yahoogrupos.com.br [mailto:[EMAIL PROTECTED] On Behalf Of
Alencar - Philler Informatica
Sent: Sunday, January 22, 2006 1:59 PM
To: delphi-br@yahoogrupos.com.br
Subject: Re: [delphi-br] [maf] Resetar variavel
poderia ser reescrito assim
if (TForm.Components[Cont] is TLabel
poderia ser reescrito assim
if (TForm.Components[Cont] is TLabel) then
TLabel(TForm.Components[Cont]).Caption := '';
O as não é necessário, já que você já usou o is.
Daniel Polistchuck
Consulting Services Manager
Ola Daniel.
Gosto de saber o porquê das coisas, pois isso
Olá Eleazar,
Só uma sugestão. Seu código:
{ Verifico se o mesmo é um label }
if (TForm.Components[Cont] is TLabel) then
{ Se for um label, entao dou um cast (procure no help do delphi
sobre 'is' e 'as')
ajustando o caption do mesmo para '' }
Boua essa daí mestreual
[]'s
Topolniak.
- Original Message -
From: Daniel Polistchuck [EMAIL PROTECTED]
To: delphi-br@yahoogrupos.com.br
Sent: Thursday, January 19, 2006 2:31 PM
Subject: RE: [delphi-br] [maf] Resetar variavel
Olá Eleazar,
Só uma sugestão. Seu código
for i:= 1 to 140 do
TLabel(FindComponent('Label'+lntToStr(i))).Caption := ''
- Original Message -
From: tecnisystems
To: delphi-br
Sent: Wednesday, January 18, 2006 6:17 PM
Subject: [delphi-br] [maf] Resetar variavel
Pessoal
Tenho a seguinte duvida. Suponhamos que
Mano, tenta assim ó:
var
i:Smallint;
begin
{---}
For i := 1 To ComponentCount - 1 Do
If (Components[i] Is TLabel) Then
with Components[i] As TLabel Do
Caption:='';
End;
Verifique o código por favor, pois não compilei
[]'s
6 matches
Mail list logo