Bug assigning Str variable

edited 8:18PM 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 8:18PM
    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 8:18PM
    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 8:18PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.