Que tipo de variavel eu coloco para usar como conjunto ?

Delphi

09/02/2005

Que tipo de variavel eu coloco para usar como conjunto ?

if 1 in VARIAVEL then




Muito grato desde já!


Programadorjlle

Programadorjlle

Curtidas 0

Respostas

Marcio.theis

Marcio.theis

09/02/2005

Você poderia explicar melhor?


GOSTEI 0
Programadorjlle

Programadorjlle

09/02/2005

if 1 in [0..9] then ´DA CERTO´
if 1 in VARIAVEL then ´QUALQUER TIPO DE VARIAVEL DA ERRRADO´

Queria saber substituo o conjunto por uma variavel ?

[quote:7fe27daa70=´/]/]@t´]Você poderia explicar melhor?[/quote:7fe27daa70]


GOSTEI 0
Marcio.theis

Marcio.theis

09/02/2005

O que eu acredito que se possa fazer é o seguinte:

if 1 in [variavel..variavel2] then

mas

if 1 in [variavel] then

somente se for exatamente igual a sua variável.


GOSTEI 0
Programadorjlle

Programadorjlle

09/02/2005

MAIS TEM COMO FAZER COMO UMA STRING PQ NAO É UM VALOR SOH ?
var
axSTR : String;
begin
axSTR := ´0,1,2,3´;
if 1 in [axSTR] then begin
end;
end;



[quote:44a1738317=´/]/]@t´]O que eu acredito que se possa fazer é o seguinte:

if 1 in [variavel..variavel2] then

mas

if 1 in [variavel] then

somente se for exatamente igual a sua variável.[/quote:44a1738317]


GOSTEI 0
Vprates

Vprates

09/02/2005

Não sei se eh o certo mas vc poderia utilizar um stringlist tipo:
Var Stl : TStringlist;
I: Integer;
Begin
Stl := TStringlist.create;
stl.Texte := String1, String2, etc...
For I:=0 to Stl.count-1 do
if 1 in stl[I] then
faz oque vc precisa;

Não testei mas acho que eh isso...
vlw


GOSTEI 0
Nildo

Nildo

09/02/2005

Como a duvida se transformou em outra, eu respondí aqui:

http://forum.clubedelphi.net/viewtopic.php?t=58384


GOSTEI 0
POSTAR