https://bugs.freedesktop.org/show_bug.cgi?id=51433

             Bug #: 51433
           Summary: Intermittent Error - Inadmissible value or data type.
                    Data type mismatch.
    Classification: Unclassified
           Product: LibreOffice
           Version: 3.5.4 release
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
        AssignedTo: [email protected]
        ReportedBy: [email protected]


By "intermittent", I do NOT mean that the bug can only be reproduced sometimes.
It can ALWAYS be reproduced if you follow the directions below precisely.  By
"intermittent", I mean that if you wander from the precise instructions given,
the results become unpredictable.  Entering the same input can lead to
different behavior depending on how you got there.

I have reproduced it on 3.4.5 running on Linux Mint Debian 64-bit and on 3.3
and 3.5.4.2 running on Windows XP.

Steps to reproduce:
1) Open Calc and start with a new empty spreadsheet file.
2) Click Tools, Macros, Organize Macros, LibreOffice Basic...
3) Click "Untitled 1", click New, click OK.
4) In the code editor, press Ctrl+A then Delete to clear any automatic skeleton
code.
5) Enter the following code:
Function Q(a, b)
 Q = IIf(a MOD b = 0, 0, b - (a MOD b))
End Function
6) Go to cell A1; enter the formula "=Q(4,3)".
(no error, result is 2)
7) In the code editor, change the name of the function on lines 1 and 2 from
"Q" to "R" (example - other names will work).
8) Change the formula in A1 to read "=R(4,2)".
(no error, result is 0)
9) Again, change the formula in A1 to now read "=R(4,3)"; enter.
(You are taken back to the code editor; line 2 is highlighted; The message box
reads "Inadmissible value or data type. Data type mismatch.")

Extra credit:
Change the function name again (e.g. "Foo")
Change the formula to "=FOO(4,3)". (no error)
Change the formula to "=FOO(4,4)". (no error)
Change the formula to "=FOO(4,5)". (now you get the error as described above)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- 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

Reply via email to