Lazarus

Programming => Packages and Libraries => LazReport => Topic started by: tshumak on September 28, 2014, 11:36:56 pm

Title: Scripts: Statement evaluation
Post by: tshumak on September 28, 2014, 11:36:56 pm
I must be doing something wrong here, but I'm having trouble getting expressions in scripts to work.

Code: [Select]
A := [B] + [C]; where all three variables are numeric. Works fine for string values. 

The statement does not execute.  when I look at variable A through a MessageBox it returns empty.  Ive also tried:

Code: [Select]
A := [[B] + [C]]; and
A := SUM([B]+[C]);
A := [SUM([B]+[C])];


According to the free report booklet, section 6.2 The expression should work and Paragraph: Aggregate functions, SUM is supposed to work as well.

A little more background, this statement is implemented in the MasterDataBand1 script field.  B and C are passed to the report frReport1GetValue statement.  The variables are declared in the variable list in the report.

Also OS: Win7Pro-64 bit Lazarus: 1.2.4 FPC: 2.6.4 SVN: 45510 i386-win32-win32/win64

Right now I have it working in the program source.  I would like to have it calculated in the report if I can.

Any ideas [where|what] Im [g|d]oing wrong?
Title: Re: Scripts: Statement evaluation
Post by: Mike.Cornflake on September 29, 2014, 12:26:43 am
Could you edit your original post, select all the individual code segments and press the # button on the editor toolbar?  This will wrap your code in [ code ] tags.  As it is, I suspect you have some [ b ] in your code, and the forum is treating that as a start BOLD tag, and stopping us from seeing the full code...

You can press preview to ensure it's looking good before you save the results :-)
Title: Re: Scripts: Statement evaluation
Post by: tshumak on September 29, 2014, 03:22:33 am
Ok, did not realize it went to bold mode.
Title: Re: Scripts: Statement evaluation
Post by: zeljko on October 06, 2014, 04:42:54 pm
A := [B + C]; should work.
TinyPortal © 2005-2018