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
Testar Valores De Um Tmemo
Started By proteus_adi, 26/02/2004, 12:35
2 replies to this topic
#1
Posted 26/02/2004, 12:35
PROTEUS [ADSUMUS]
ETERNAL ########
---------------------------------------------------------------
"Já dizia o mestre: PROGRAMAR é diferente de CODIFICAR"...
ETERNAL ########
---------------------------------------------------------------
"Já dizia o mestre: PROGRAMAR é diferente de CODIFICAR"...
#2
Posted 05/03/2004, 12:33
consegui algo parecido com um
while pos< length(richedit1.text) do...
alguem ai tem uma outra ideia?
while pos< length(richedit1.text) do...
alguem ai tem uma outra ideia?
PROTEUS [ADSUMUS]
ETERNAL ########
---------------------------------------------------------------
"Já dizia o mestre: PROGRAMAR é diferente de CODIFICAR"...
ETERNAL ########
---------------------------------------------------------------
"Já dizia o mestre: PROGRAMAR é diferente de CODIFICAR"...
#3
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...
Vc pode chamar a função assim:
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
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)