[fpc-pascal] LongStrings Question

Evandro Sestrem evandro at blueone.com.br
Fri Mar 3 14:20:47 CET 2006



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




More information about the fpc-pascal mailing list