Recent

Author Topic: CreateRPNFormula does not work  (Read 3335 times)

cpalx

  • Hero Member
  • *****
  • Posts: 753
CreateRPNFormula does not work
« on: October 21, 2014, 04:25:29 am »
Hello

i updates FPspreadsheet and does not work anymore: CreateRPNFormula, RPNCellRange, fekSUM

the FPspreadsheet is last svn (20/10/2014)
i work in Linux (Kubuntu 64bits 14.04)
compiled in QT

any idea?

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: CreateRPNFormula does not work
« Reply #1 on: October 21, 2014, 04:54:54 am »
I don't know the answer, but I suspect those that do are going to need more information :-)

What do you mean by "does not work anymore"?

a) Code no longer compiles
b) Code compiles, but at runtime an error or exception is raised
c) No error or exception, but while an output is expected, none occurs (ie null, empty string or 0 output)
d) An output occurs, but it is wrong (ie expected 5, got 4)
e) Something completely different (and if so, please explain further :-) )

And chance you can post a small code snippet showing how you're using these functions?
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

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: CreateRPNFormula does not work
« Reply #2 on: October 21, 2014, 09:26:24 am »
There has been a major rework of the formula stuff. In order to use RPN functions you have to "use" the unit fpsrpn. Function token identifiers fekXXXX of function names (e.g. "fekSUM") must be replaced by the function name ("SUM") - see the wiki http://wiki.lazarus.freepascal.org/FPSpreadsheet#Using_built-in_operations_and_functions. But most of all, you can apply string formulas directly now, e.g. "SUM(A1:G5)".

Sorry for the inconvenience. There's a section in the wiki on incompatible changes http://wiki.lazarus.freepascal.org/FPSpreadsheet#Incompatible_changes.

cpalx

  • Hero Member
  • *****
  • Posts: 753
Re: CreateRPNFormula does not work
« Reply #3 on: October 21, 2014, 02:09:43 pm »
Thanks, CreateRPNFormula now works, but i dont know howto replace this:

Code: [Select]
WriteRPNFormula(MyRow, MyCol, CreateRPNFormula( RPNCellRange('F2:F5',   RPNFunc(fekSUM, 1, nil))) );

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: CreateRPNFormula does not work
« Reply #4 on: October 21, 2014, 02:30:03 pm »
Use 'SUM' instead of fekSUM
Code: [Select]
  WriteRPNFormula(MyRow, MyCol, CreateRPNFormula(
    RPNCellRange('F2:F5',   
    RPNFunc('SUM', 1,
    nil)))
  );

Or, use the string formula directly:
Code: [Select]
  WriteFormula(MyRow, MyCol, 'SUM(F2:F5)');


cpalx

  • Hero Member
  • *****
  • Posts: 753
Re: CreateRPNFormula does not work
« Reply #5 on: October 21, 2014, 03:11:45 pm »
thanks

 

TinyPortal © 2005-2018