Bug assigning Str variable

edited 1:14PM in FastReport VCL 5
Hi,
In a form I have a text variable named 'X' and his initial value is 'Hi'

Memo1 is: [X]

In Delphi code I have:

FRReport.Variables := ''''+'Hello'+'''';

And then I get in the report:
Hello
(Whitout quotes).

Now, if I wrote:

FRReport.Variables := ''''+'Hello'+#13#10+'World'+'''';
then I get:
'Hello
World'

(With a quote at the begining and at the end).

I guess the correct result should be:
Hello
World
(Whitout quotes).

Regards.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 1:14PM
    THIS IS NOT A BUG
    READ THE PROGRAMMERS MANUAL ON MODIFYING A VARIABLES VALUE
    All single quotes must be doubled;

    - string should not contain #13#10 symbols.

  • edited 1:14PM
    gordk wrote: »
    THIS IS NOT A BUG
    READ THE PROGRAMMERS MANUAL ON MODIFYING A VARIABLES VALUE
    All single quotes must be doubled;

    - string should not contain #13#10 symbols.

    Not happy about it should not contain #13#10... but you're right.

    Thanks.
  • edited 1:14PM
    I found a workaround:

    Now, if my string has #13#10 then I ommit the quotes

    FRReport.Variables := 'Hello'+#13#10+'World';

    All works perfect this way.

    Regards.

Leave a Comment