Existe a possibilidade de realizar este teste em delphi sendo a variavel
stparametro262 uma string ??
Com char é possível, mas com string é ??
if stParametro262 ['00', '01', '02', '03', '04', '05', '06', '07', '08']
then
[mailto:delphi...@yahoogrupos.com.br] Em
nome de Berdam
Enviada em: sexta-feira, 4 de dezembro de 2009 16:14
Para: Delphi
Assunto: [delphi-br] Testar string
Existe a possibilidade de realizar este teste em delphi sendo a variavel
stparametro262 uma string ??
Com char é possível, mas com string é
: [delphi-br] Testar string
Prioridade: Alta
Faça assim:
case AnsIndexStr(stParametro262, [00, 01, 02, 03, 04, 05, 06,
07, 08]) of
0: ShowMessage(00); // é o primeiro elemento
1: ShowMessage(01); // é o segundo elemento
{ ... e por aí vai! }
end;
A estrutura case do
If pos(stParametro262 ,'00,01,02,03,04,05,06,07,08')=0 then
Berdam escreveu:
Existe a possibilidade de realizar este teste em delphi sendo a variavel
stparametro262 uma string ??
Com char é possível, mas com string é ??
if stParametro262 ['00', '01', '02', '03', '04', '05', '06',
Como testar se uma string somente contem números ???
--
Marcelo Carvalho
Carvalho Informatica Ltda
MSN [EMAIL PROTECTED]
--
FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM
Para ver as mensagens antigas, acesse:
http://br.groups.yahoo.com/group/delphi-br/messages
Para falar com o
try
StrToInt( valor );
except
raise Exception.create('numerom invalido');
end;
- Original Message -
From: Marcelo Carvalho [EMAIL PROTECTED]
To: delphi-br@yahoogrupos.com.br
Sent: Wednesday, April 06, 2005 11:36 AM
Subject: [delphi-br] Testar String
Como testar se uma string
Tente isso:
function ChecaString(strCheck : string):boolean;
var
i : integer;
begin
ChecaString := false;
for i:=1 to Lenght(strCheck) do
if (strCheck[i] in '0..9') or (strCheck[i] = ',') or (strCheck[i] = '.')
then
ChecaString := true
else
begin
7 matches
Mail list logo