[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

*Subject*: **[OASIS Issue Tracker] (OFFICE-3844) Semantics to function IF part 2, section 6.15.4, does not cover all syntax variants and is ambiguous in at least one case**

*From*:**OASIS Issues Tracker <workgroup_mailer@lists.oasis-open.org>***To*: office@lists.oasis-open.org*Date*: Mon, 26 Feb 2018 18:51:52 +0000 (UTC)

[ https://issues.oasis-open.org/browse/OFFICE-3844?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Regina Henschel updated OFFICE-3844: ------------------------------------ Proposal: Proposal: Semantics: Computes Condition. If it is TRUE, it returns IfTrue, else it returns IfFalse. This function only evaluates either IfTrue or IfFalse, and never both; that is to say, it short-circuits. Seven versions are possible: One parameter: a) IF(Condition) Two parameters: b) IF(condition;) c) IF(condition;IfTrue) Three parameters: d) IF(condition;;) e) IF(condition;;IfFalse) f) IF(condition;IfTrue;) g) IF(condition;IfTrue;IfFalse) If there is only 1 parameter (case a), IfTrue is considered to be TRUE() and IfFalse is considered to be FALSE(). Thus the 1 parameter version converts Condition into a Logical value. If there are 2 parameters (cases b and c), IfFalse is considered to be FALSE(). If there are 2 parameters and the second parameter is null (semicolon but no IfTrue, case b), IfTrue is considered to be 0. If there are 3 parameters but the second parameter is null (two consecutive ;; semicolons, cases d and e), IfTrue is considered to be 0. If there are 3 parameters but the third parameter is null (semicolon but no IfFalse, cases d and f), IfFalse is considered to be 0. was: Proposal: Semantics: Computes Condition. If it is TRUE, it returns IfTrue, else it returns IfFalse. This function only evaluates IfTrue, or ifFalse, and never both; that is to say, it short-circuits. If there is only 1 parameter, IfTrue is considered to be TRUE() and IfFalse is considered to be FALSE(). Thus the 1 parameter version converts Condition into a Logical value. If there are 2 parameters, IfFalse is considered to be FALSE(). If there are 2 parameters and the second parameter is null (semicolon but no IfTrue), IfTrue is considered to be 0. If there are 3 parameters but the second parameter is null (two consecutive ;; semicolons), IfTrue is considered to be 0. If there are 3 parameters but the third parameter is null (semicolon but no IfFalse), IfFalse is considered to be 0. > Semantics to function IF part 2, section 6.15.4, does not cover all syntax variants and is ambiguous in at least one case > -------------------------------------------------------------------------------------------------------------------------- > > Key: OFFICE-3844 > URL: https://issues.oasis-open.org/browse/OFFICE-3844 > Project: OASIS Open Document Format for Office Applications (OpenDocument) TC > Issue Type: Bug > Components: OpenFormula, Part 2 (Formulas) > Affects Versions: ODF 1.2 > Reporter: Regina Henschel > Fix For: ODF 1.3 > > > When I resolve the optional parts [], I get seven valid syntax variants, here without data type. > A: IF(Condition) > B: IF(Condition;) > C: IF(Condition;IfTrue) > D: IF(Condition;;) > E: IF(Condition;;IfFalse) > F: IF(Condition;IfTrue;) > G: IF(Condition;IfTrue;IfFalse) > Some of them have missing parts. I should be able to determine the correct resulting value from the "Semantics"-part. But that is not possible for all variants. > (use non-proportional font to get the table nice formatted) > Condition |Condition |Text in part Semantics > evaluates |evaluates |and the fitting syntax variants > to TRUE |to FALSE | > --------------+---------------+-------------------------------- > result TRUE() | | "If there is only 1 parameter, IfTrue is > | | considered to be TRUE()" fits to A > --------------+---------------+---------------------------------- > | result FALSE()| "If there are less than 3 parameters, IfFalse > | | is considered to be FALSE()" fits to A,B,C > --------------+---------------+----------------------------------- > | result 0 | "If there are 2 or 3 parameters but the second > | | parameter is null (two consecutive ;; > | | semicolons), IfFalse is considered to be 0." > | | fits to B,D,E, perhaps C fits too. > --------------+---------------+----------------------------------- > | result 0 | "If there are 3 parameters but the third > | | parameter is null, IfFalse is considered to > | | be 0." fits to D,F > Problems: > (1) Variants B and C are ambiguous, see row 2 and row 3 > (2) Why is a rule for IfFalse given, when the second parameter is missing, see row 3? > (3) If the third parameter is not null but IfFalse, then IfFalse should be returned, if Condition is FALSE, but semantics say 0 in row 3. > (4) For Condition TRUE in variants B, D and E no value for the missing second parameter is given. Perhaps the text "If there are 2 or 3 parameters but the second parameter is null (two consecutive ;;semicolons), *IfTrue* is considered to be 0." was intended? > (5) It is not clear, whether C fits to row 3. > Remarks. > In variant B and C with condition FALSE, Gnumeric and Excel return FALSE > In variant B,D, and E with condition TRUE, Gnumeric and Excel return 0 for the missing second parameter. > In variant E with condition FALSE, Gnumeric and Excel return IfFalse and not 0. > LibreOffice and AOO does not handle variants with ;; or ;) -- This message was sent by Atlassian JIRA (v6.2.2#6258)

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]