Wilfried Mestdagh wrote:
> Hello Fred,
> 
>> Because AFAIK, the length of a string is only 256 ... 
> 
> So if not correct typecasted to a string it is truncated to 256 chars ?

No. PChars have been assignable to strings since at least Delphi 2, 
perhaps Delphi 1, without the need for type-casts. (Prior to that, a 
type-cast would not have been appropriate anyway. That's what the StrPas 
function was for.)

Strings have had practically unlimited length since Delphi 2 as well. 
Their lengths are limited only be your process's memory.

ShortStrings are limited to 255 characters. You can make "string" refer 
to ShortString instead of AnsiString with the $H- compiler directive, 
but I don't recommend that. As of Delphi 5, operations on ShortStrings 
are performed on temporary AnsiStrings anyway.

-- 
Rob
__________________________________________________
Delphi-Talk mailing list -> Delphi-Talk@elists.org
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to