Page 1 of 1

Err:508

Posted: Sat Oct 24, 2009 3:51 am
by KHousley
I have OpenOffice 3.0.1 OOO300m15 (Build:9379) on Linux kubuntu 9.04. I got an error in Calc when I tried to enter a formula for changing the background color of a cell when it is non-zero. First, I created a style named "ORANGE" and then tried to enter this formula:

=(D4-E4)+(H4+(STYLE(IF(CURRENT()=0; "DEFAULT"; "ORANGE"))))

The error says at the bottom of the window "Error: in bracketing".

I tried editing the formula in a separate editor before I copy-pasted it into the cell. In the editor which automatically checks for paired parenthesis, the editor says that all pairs are matched. In the functions (organized by category) section of the documentation there are a couple of examples showing how to use an "IF" function as an argument to the "STYLE" function as I have done. Also, I have tried taking the "IF" function out and replacing it with simply "ORANGE" as the argument to the STYLE function and that gives me an orange background always with no error.

Has anyone else had a problem with this error? What can I do to change the cell to an orange background only when (D4-E4)+H4 is non-zero?

Thanks,
KHousley

Re: Err:508

Posted: Sat Oct 24, 2009 4:45 am
by FJCC
I think the problem is that the CURRENT() function is evaluated while there are still open parenthesis in the part of the formula before the STYLE function. On my system the formula doesn't produce an error, but it doesn't evaluate correctly either. The ORANGE style is never applied. This version, with fewer parenthesis does work.

Code: Select all

=D4-E4+H4+STYLE(IF(CURRENT()=0; "DEFAULT"; "ORANGE"))

Re: Err:508

Posted: Sat Oct 24, 2009 5:57 pm
by KHousley
Thanks, FJCC, for your reply. I copy-pasted your code into the cell, and still got the same error. I cut it down still further and still got the error until I cut it down to

Code: Select all

=(D4-E4)+H4+STYLE("ORANGE")
which, of course, always gives me the orange background regardless of the value of the cell, but it gives me the correct value of the cell.

By the way, I looked on the "Survival Guide" for BBCode, and found nothing about it. How can I find our more about BBCode? After looking at the page source, I am guessing about how to create the CODE box that I see you and others have used.

KHousley

Re: Err:508

Posted: Sat Oct 24, 2009 7:40 pm
by Hagar Delest
There are buttons just above the message area when you reply. Just click the button and preview the message if needed.

Re: Err:508

Posted: Sat Oct 24, 2009 7:55 pm
by FJCC
I can't explain why the formula doesn't work. I did find this issue listed on the Issue Tracker with the status Unconfirmed. The reporter is also on Linux, though not the same OOo version as yours. I don't seem to see the problem on my StarOffice 9.1 on XP. You could add your information to that thread, which would help the developers see that it is not just one user.
A work around for your problem would be to use conditional formatting. Go to Format -> Conditional Formatting and set "Cell value is", "not equal to", 0 and the Cell Style to ORANGE.

Re: Err:508

Posted: Sat Oct 24, 2009 8:02 pm
by Hagar Delest