https://bugs.freedesktop.org/show_bug.cgi?id=51433
--- Comment #2 from [email protected] --- Thank you Thomas. The bug still reproduces for me exactly as described in the original bug report. I've tried on both the 4.0.2 that is current for Kubuntu 13.04 as well as with 4.0.4.2 from Calculate 13.6.1 (a Gentoo based distro). I think 4.0.4 is the latest stable release and I'm not sure how I'd try it on the newer version that you tried (4.1.0.1) unless I installed Debian Testing. I'm guessing your inability to reproduce the bug was either due to misunderstanding my directions or not following the steps closely enough. I'm not a developer nor a Basic geek either, but I think I can explain briefly how this should work, and maybe you can get past step 6 to reproduce the bug. (The TLDR of this is as follows: 1) No positive integers as arguments to this function should ever cause an error. 2) Simply changing the name of the function should not result in an error when the same arguments didn't cause an error using the previous function name.) I make a function in the Basic editor, then I access it by using it in a spreadsheet formula (changing the name to all-caps, of course). The function takes 2 arguments, which we name 'a' and 'b'. The body of the function consists of this single line: Q = IIf(a MOD b = 0, 0, b - (a MOD b)) "Q = " means set the return value of the function to the value of the expression which follows. "IIf" means "immediate if". The "IIf" function requires 3 arguments. It evaluates the truth of the 1st argument and returns either the 2nd argument (if True) or the 3rd argument (if False). So, in the example above, the value 0 should be returned whenever the first argument to IIf is True, otherwise it should evaluate and return the 3rd argument. "MOD" is a binary operator that evaluates to the remainder when dividing the first operand by the second. "=" is a binary operator that evaluates True if the operands are equal, False otherwise. "-" is a binary operator that evaluates to the remainder of the second operand subtracted from the first. So here's the initial example: In the spreadsheet you've entered "=Q(4,3)". So when the function runs, 'a' will be equal to 4 and 'b' will be equal to 3. Substituting those values in we get: Q = IIf(4 MOD 3 = 0, 0, 3 - (4 MOD 3)) Simplify, starting with the MOD operator: Q = IIf(1 = 0, 0, 3 - (1)) Now the other two: Q = IIf(False, 0, 2) So 2 is the answer you should get in step 6 by following the directions. If you're getting an error there, you've either not followed the steps correctly or you've discovered another separate bug on your version of LO [not likely]. Based on the error message you gave, it could be that you mistakenly entered "=Q(4.3)" instead of "=Q(4,3)". "Q" requires 2 arguments [e.g. 4,3] whereas 4.3 is a single value so you would have gotten that "Argument is not optional." error. Just make sure you're following the directions carefully. After step 6, we change the name of the function in the code editor from "Q" to "R", then in the worksheet simultaneously update the function name and change the value of the second argument from 3 to 2. The value is now 0 because 4 is evenly divisible by 2. You don't get the error until step 9 when you change the second argument back to 3. (If you're still having trouble understanding my steps to reproduce the bug, I could possibly do a screen capture and upload the video for you to watch.) > And what I miss, is a description, what you have inspected ... ;) I'm not sure I understand the question. I haven't inspected anything because I'm not a developer - I was just reporting the bug. I know there are other ways to write such a function, and I don't even remember what I was doing a year ago. This was probably just simplified from a more complex function while preserving the ability to reproduce the bug. -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ Libreoffice-bugs mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
