2009/6/19 Niklas Nebel <[email protected]>:
> On 06/19/09 11:50, Johnny Rosenberg wrote:
>>
>> I have a little follow up question to this:
>> When OpenOffice.org 3 arrived, some of my formulas stopped working,
>> because in some of my calculations a few empty cells were apart of it.
>> They told me that empty cells doesn't have the value 0 anymore, like
>> it had before and they also said that this is a good thing and so on.
>> So I had to modify a lot of formulas to make my spreadsheets work
>> again. Not too hard, but a lot of work. Now it seems like empty cells
>> are considered 0 again, at least I couldn't reproduce that ”new”
>> behaviour anymore.
>>
>> The problem described in this thread was tested on OpenOffice.org Calc
>> 3.1.0. I also have a OpenOffice.org Calc 3.0.1 installation on a
>> Mandriva system. Maybe I should try the same thing on that one too.
>> Maybe the outcome will be different?
>
> Handling of empty cells in formulas was changed in 3.0
> (http://sc.openoffice.org/servlets/ReadMsg?list=features&msgNo=263), but not
> for Basic functions. That's still valid in 3.1. It's hard to say what causes
> your changed results without seeing the formulas.

Well, the workaround Jan suggested works, so I guess I will go with
it, at least until I know a better way.

There is not much formulas to see since I didn't finish my ”project”.
I only wrote a simple test function and debugged it and studied the
involved variable.

Something like this:
Function MyFunction(A As Variant) As Variant
   MyFunction=A
End Function

I then added a break point to the first line.

Then I entered the following in B1:
=MYFUNCTION(A1)

That started the function which stopped at my breakpoint. I then press
F8 to go to the next step and I study A by highlighting A and pressing
F7. A appear in the variables section and I could see that it was a
”Variant/Double”. A1 was empty, so this was surprising since I
expected A to be a ”Variant/String”. So whatever more code I write I
can never see if A1 is empty or just 0, at least not as far as I know.

As I see it, this behaviour is a kind of shortcomming. It would have
been nice if A was an object instead, making code like this possible:

Function MyFunction(A As Object) As Object
   If A.getString()="" Then
      MyFunction="Empty"
   ElseIf A.getValue()>50
      MyFunction="Oh my, you have really big feet!"
   Else
     MyFunction="Well, whatever…"
   Endif
End Function

Well, something like that… this is only something that I came up with
after thinking about it for a minute or two, maybe there are better
ideas out there, when it comes to suggestions for enhancements…

Johnny Rosenberg

>
> Niklas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to