converting Calc functions to jump functions

Winfried Donkers W.Donkers at dci-electronics.nl
Thu Jun 2 07:18:51 UTC 2016


Hi Eike,

I started converting the new Calc functions IFS and SWITCH to jump functions.
So far, the general part has been done.

I experience a problem where the functions IFS and SWITCH differ from the other jump functions (IF, CHOOSE, IFERROR, IFNA).
The other jump functions do 1 evaluation (of the first argument) and then jump to an argument that is to be the output.
The new jump functions need to evaluate at least 2 arguments.
And that is where I get stuck.

The first argument is on the stack, i.e. GetStackType() returns a type and ScInterpreter::sp is 1.
When I jump to the next argument to be evaluated, with aCode.Jump( pJump[ nIdx ], pJump[ pJump[ 0 ] ] ), ScInterpreter::sp is 0 afterwards.
How do I get the argument I jumped to (that part works) on the stack to be evaluated?

I hope you can shed some light on this jump mechanism.

Winfried

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20160602/c2a92b96/attachment.html>


More information about the LibreOffice mailing list