Move

Delphi

28/09/2004

Colegas:
var s:String[2];
begin
  Move(PChar(´xx´)^, s[1], 2); // funciona
  Move(PChar(´x´)^, s[1], 1);  // Access Violation
end;

Alguém saberia o pq do Access Violation :?:


Ipc$

Ipc$

Curtidas 0

Respostas

Beppe

Beppe

28/09/2004

A literal ´x´ é um Char. Não são Strings, em nivel de implementação. Tente
Move(PChar(String(´x´))^, s[1], 1);



GOSTEI 0
Ipc$

Ipc$

28/09/2004

Valeu Beppe, funcionou.
Obrigado !!!


GOSTEI 0
POSTAR