Jump to content


Photo

Testar Valores De Um Tmemo


  • Faça o login para participar
2 replies to this topic

#1 proteus_adi

proteus_adi

    @handle:=proteus;//>>>

  • Usuários
  • 309 posts
  • Sexo:Não informado
  • Localidade:Minas Gerais>> Belo Horizonte
  • Interesses:Programação e Web>>>

Posted 26/02/2004, 12:35

COMO EU FAÇO PRA DESMEMBRA UM TMEMO TIPO UMA MATRIS,
PARA TESTAR ESTES VALORES, VER SE HÁ OCORRENCIA DE CERTA PALAVRA.........

OU SE DEVO FAZER ISSO DE OUTRO JEITO
PROTEUS [ADSUMUS]
ETERNAL ########
---------------------------------------------------------------
"Já dizia o mestre: PROGRAMAR é diferente de CODIFICAR"...

#2 proteus_adi

proteus_adi

    @handle:=proteus;//>>>

  • Usuários
  • 309 posts
  • Sexo:Não informado
  • Localidade:Minas Gerais>> Belo Horizonte
  • Interesses:Programação e Web>>>

Posted 05/03/2004, 12:33

consegui algo parecido com um

while pos< length(richedit1.text) do...

alguem ai tem uma outra ideia?
PROTEUS [ADSUMUS]
ETERNAL ########
---------------------------------------------------------------
"Já dizia o mestre: PROGRAMAR é diferente de CODIFICAR"...

#3 The Tamer

The Tamer

    'F' motivos para se gostar de Hexa

  • Usuários
  • 185 posts
  • Sexo:Não informado

Posted 08/03/2004, 09:18

Já tentou fazer uma "quebra de strings"?

Usando o caracter espaço " " para definir o local da quebra?

O Código abaixo faz a quebra de uma String, você coloca a String, depois o char de quebra, (o espaço) e no caso, esta função pede o Objeto TStringList... pois ele joga o texto quebrado 1 em cada linha da StringList, aí vc pode adaptar o código abaixo para jogar em um vetor, etc...

function sBreakApart(BaseString, BreakString: string; StringList: TStringList): TStringList;
var
EndOfCurrentString: byte;
TempStr: string;
begin
repeat
EndOfCurrentString := Pos(BreakString, BaseString);
if EndOfCurrentString = 0 then
StringList.add(BaseString)
else
StringList.add(Copy(BaseString, 1, EndOfCurrentString - 1));
BaseString := Copy(BaseString, EndOfCurrentString + length(BreakString), length(BaseString) - EndOfCurrentString);
 
until EndOfCurrentString = 0;
result := StringList;
end;

Vc pode chamar a função assim:

procedure TForm1.Button1Click(Sender: TObject);
var
t: TStringList;
begin
t := TStringList.create;
ListBox1.Items.Assign(sBreakApart(Edit1.Text, ' ', t));
t.free;
end;

__________________________________________
The Tamer
Quando morrer, escrevam em minha lápide: </life>

Blog: http://www.dtsoftware.eti.br/
MCWD - Macromedia Certified Web Designer MX




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq