Ler memo e colocar em array.
Como faço para ler um caracter por vez de um memo e colocar em um Array de Char com tamanho igual ao total de caracteres do memo?
Leitorbinario
Curtidas 0
Respostas
Bruno Belchior
31/07/2007
Isso deve ajudar:
function SetCharArray(pText: string): TCharArray; var ret: TCharArray; i, lgth: Integer; begin lgth := Length(pText); SetLength(ret,lgth); for i := 1 to lgth+1 do ret[i-1] := pText[i]; Result := ret; end;
GOSTEI 0
Leitorbinario
31/07/2007
Tentei usar o texto do memo na função mas deu o seguinte erro.
Undeclared identifier: ´TCharArray´
Imcompatible types
Undeclared identifier: ´TCharArray´
Imcompatible types
GOSTEI 0
Bruno Belchior
31/07/2007
Isso é um tipo criado na sessão type...
type TCharArray = array of char;
GOSTEI 0