Sign in Join

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

Mailing lists / fpc-pascal / 2006-03

LongStrings Question

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Evandro Sestrem

Hi,

I'm using {$LONGSTRINGS ON} to use a string variable like ansistring.

In this example, if I uncomment the s1 variable I got "Error: Constant strings can't be longer than 255 chars", but if I uncomment the s2 variable (formed by concatenation of strings) the project compiles perfectly.

program testLongString;
{$LONGSTRINGS ON}
var
  s1, s2: String;
begin
 // test strings with more than 255 characters
//  s1:= '1         1         1         1         1         1         1
1         1         1         1         1         1         1         1
1         1         1         1         1         1         1         1
1         1         1         1      end';

{

  s2:= '1         1         1         1         1         1         1

1 1 1 1 1 ' +
'1 1 1 1 1 1 1 1 1 1 1 1 ' +
'1 1 1 1 1 1 1 1 1 1 1 1 ' +

       '1         1         1      end';

}
end.

I need use the s1 variable way because I'm receiving in a string a value read from a BD.

I also tried compile with "-Mdelphi", but the error stills the same.

Thanks in advance,

Evandro Sestrem

No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 268.1.1/273 - Release Date: 2/3/2006

Reply by email