Recent

Author Topic: Scripts: Statement evaluation  (Read 3452 times)

tshumak

  • New Member
  • *
  • Posts: 36
Scripts: Statement evaluation
« 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?
« Last Edit: September 29, 2014, 03:21:49 am by tshumak »

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Scripts: Statement evaluation
« Reply #1 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 :-)
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

tshumak

  • New Member
  • *
  • Posts: 36
Re: Scripts: Statement evaluation
« Reply #2 on: September 29, 2014, 03:22:33 am »
Ok, did not realize it went to bold mode.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Scripts: Statement evaluation
« Reply #3 on: October 06, 2014, 04:42:54 pm »
A := [B + C]; should work.

 

TinyPortal © 2005-2018