https://bugs.documentfoundation.org/show_bug.cgi?id=166232

--- Comment #20 from Cameron <[email protected]> ---
(In reply to Mike Kaganski from comment #15)

> You cannot launch a macro in safe mode, *because* you try to run it from a
> document (which shows how you do not read what I wrote: I explicitly asked
> you to test *without anything opened first*). 

Sure, I did your test. Check the new GIFs that shows it.

> You never attached a sample
> document with the data or macros (only GIFs), and your GIFs show how complex
> your documents are - and you expect people who want to reproduce your
> problem to invent your data for themselves.

I have added a sample using the code provided earlier. You can test it yourself
and see what happens.

The purpose of the GIFs are to show the tests performed on my terminal. I could
tell you "it doesn't work" to each of your tiresome comments, without those
GIFs, you wouldn't know how I performed them and most of all: you could not
identify visually the issue if you were an expert (or knew enough about the
topic).

> It should be easy to test for anyone; and in my comment 11, I
> described which steps should be enough. These steps did not include "look at
> GIFs and try to re-create something yourself; or open a document, and try to
> figure which of the sheets and which of the functions are relevant". The
> idea was: paste the code copied from here, into the "My Macros and Dialogs",
> and it would run.

And again, if you knew enough about the topic, you would make a suggestion very
much alike Robert's ("try this" or "have you tried ... ?"). These types of
comments mean the person understood the issue at stake and, combined with his
knowledge of LO, analysed the problem and made a suggestion for me to test.

You need to understand that making a simplified version of my work is
time-consuming for an issue that I am not sure I am really responsible for
(until proven otherwise).

> Just reading this already creates some confusion. It talks about "a decimal
> value between 0 and 1 (e.g.: 0.05)", and immediately provides an example of
> dividing 3 by 1.5, where both are greater than 1.

Can't believe you are actually making a case out of this insignificant detail.
You get the idea and can see it from the GIFs (and now the sample code)

> This is wrong, thousand separator has nothing to do here. 

Yes, it does. The error comes from there. It may not be the direct cause, but
it is definitely linked. I am not going back over this again as it has been
explained and shown in the GIFs.

> If it were
> relevant, then it would only affect treatment of "1.5", and if the decimal
> there would be treated as thousand separator, then the resulting number used
> in calculations would be 15 (or even 1500), and dividing 3 by any of these
> would make the result of the division not 1.5, nor 2, but a value less than
> 1 (either 0.2, or 0.002).

Look mate. This may not be a consensus but I do not see the point of having "."
and "," being different as explained in comment #1 and comment #4. Thousand
separator should only be used - in my opinion - for visual purpose only to
avoid confusion and errors.

> And here is the problem, that you use CLng. This problem has been explained
> to you by Robert in comment 6. Yes, CLng is documented [1] to return a long
> *integer*. It *necessarily* converts any floating-point number that it may
> obtain from the string, into a *whole number*. Meaning, that "1.5" is
> rounded up to 2, which produces the result that you see: 3 / 2 = 1.5. You
> were advised to use CDbl.

Yes, good point. Finally a useful comment!

> Then in comment 7 you provide another screencast, showing that you replace
> CDec with CDbl, and get an error (that you translate in comment 8). But we
> can't see the actual value in "PrixProduit_string"and "Contenance_string" -
> and your dialog is complex, e.g. with some of the controls using currency.
> 
> You are in the position to inspect the strings locally, and create the
> *simple* code for us to reproduce. "Simple" meaning: you, when preparing
> that code, put a breakpoint before the failing line; you inspect the values
> of the strings; you create the code that has these exact string literally,
> like in
> 
> sub HereIsAReallySimpleReproducingMacro
>   s1 = "2,02 euro"
>   s2 = "3,0"
>   MsgBox CDbl(s2) / CDbl(s1)
> end sub

The simplified version attached answers that request of yours.

> And note how my sample does not anybody to look at any kind of GIF, or to
> inspect something called "Sub DisplayingDialogbox" (which is even not
> referenced from "Sub Macro"!) to understand, what "ActivationInterface" is,
> and how to obtain it.

Not a very useful comment since I demonstrated the use of visually analysing a
test, before providing any kind of code samples.
The two SUBs are linked to make it work, the comments were added in the code
provided specifically to explain that...

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to