Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-01

widestrings length problem

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jesus Reyes

It seems something is wrong in widestrings, using the following program:

{$mode objfpc}{H+}
program test_widestrings;
var
  W: WideString;
begin
  W := '123456';
  if Length(W)6 then
    WriteLn('Test1 Failed, it''s ', Length(W))
  else
    WriteLn('Test1 Passed');
  SetLength(W, 6);
  if Length(W)6 then
    WriteLn('Test2 Failed, it''s ', Length(W))
  else
    WriteLn('Test2 Passed');
end.

It prints:
Test1 Passed
Test2 Failed, it's 12

Windows, FPC 2.1.1 revision 2214

Jesus Reyes A.

__________________________________________________ Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.yahoo.com.mx/

Reply by email

peter green
to Jesus Reyes

i belive there was recently a change to how widestring length was stored for OLE compatibility reasons. this bug was probablly caused by that change.

Show quoted text 43 lines
-----Original Message----- From: Behalf Of Jesus Reyes Sent: 29 January 2006 04:53 To: FPC developers' list Subject: [fpc-devel] widestrings length problem It seems something is wrong in widestrings, using the following program: {$mode objfpc}{H+} program test_widestrings; var W: WideString; begin W := '123456'; if Length(W)6 then WriteLn('Test1 Failed, it''s ', Length(W)) else WriteLn('Test1 Passed'); SetLength(W, 6); if Length(W)6 then WriteLn('Test2 Failed, it''s ', Length(W)) else WriteLn('Test2 Passed'); end. It prints: Test1 Passed Test2 Failed, it's 12 Windows, FPC 2.1.1 revision 2214 Jesus Reyes A. __________________________________________________ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.yahoo.com.mx/ _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email