Fórum Array de string #299180
12/10/2005
0
sNome := ´Fulano´; for ´Fulano´ in not meuArray do showmessage(Fulano não encontado no array);
Dá pra fazer algo semelhante a isto?
Obrigada
Celamar
Curtir tópico
+ 0Posts
12/10/2005
Rjun
Gostei + 0
12/10/2005
Raserafim
procedure... var I: Integer; begin for I := 0 to (Length(meuArray) -1) do begin if meuArray[I] = sNome then begin showmessage(sNome + ´ encontrado no array´); Break; end; end; if I > (Length(meuArray) -1) then showmessage(sNome + ´ não encontrado no array´); end;
se o tamanho do array for sempre o mesmo vc pode substituir (Length(meuArray) -1) pelo tamanho.
Gostei + 0
13/10/2005
Michael
Se a array é constante, seus valores não mudam e vc os conhece previamente, antes da execução do aplicativo. Então, qual a razão de verificar se algum deles existe?
[]´s
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)