tdf124710 convert Calc function IFS (and SWITCH) to jump function

Winfried Donkers Winfried.Donkers at dekimo.com
Tue Apr 30 11:58:05 UTC 2019


Hi Eike,

Some time ago (when I submitted a draft patch) you suggested an alternative, possible easier way, to convert IFS and SWITCH to jump functions.
The idea was not to extend the jump functionality, but to internally convert IFS and SWITCH to IF:
IFS( b1, r1, b2, r2 ) should become IF( b1, r1, IF( b2, r2 ) )
and
SWITCH( x, v1, r1, v2, r2 ) should become IF( x = v1, r1, IF( x=v2, r2 ) ).
For the IFS example you gave the RPN code : 'b1 ocIf r1 , b2 ocIf , r2 )' .

I have two questions about this:
-Shouldn't the RPN code be 'b1 ocIf r1 , b2 ocif r2 ) )'?
-Am I right in thinking that this construction means that all conditions (b1, b2, etc.) are evaluated upon placing them on the stack, or is each condition only evaluated when taken from the stack?

Winfried

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


More information about the LibreOffice mailing list