2011/10/19 Tomas Hajny <xhaj...@hajny.biz>:
> Sorry for a silly question, but why the difference between the two
> implementations (i.e. why not addressing the WideStr element directly
> without the typecast)?

Actually it should be a pointer operation in the ansistring version
too, because setting chars in a string calls UniqueString, which is
undesirable and inneficient.

> Moreover, even if using the PWideChar, I believe
> that the correct version would be without the '@' (i.e.:
> PWideChar(widestr)[len] := #0), wouldn't it?

Good idea! I think you found the problem.

-- 
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to