Apache OpenOffice (AOO) Bugzilla – Issue 74147
Mod with Currency generates type mismatch
Last modified: 2017-05-20 11:27:40 UTC
Sub Main Dim i As Integer Dim cCur As Currency cCur = 1 i = cCur Mod 2 ' When run within a .ods file under OOo 2.1 under WXP Pro SP2 the above ' generates error "Inadmissible value or data type. Data type mismatch" ' According to the online help: ' Mod Operator [Runtime] ' Returns the integer remainder of a division. ' Syntax: ' Result = Expression1 MOD Expression2 ' Return value: ' Integer ' Parameters: ' Result: Any numeric variable that contains the result of the MOD operation. ' Expression1, Expression2: Any numeric expressions that you want to divide. ' Both cCur and 16 are numeric expressions ' The integer result should be coerced to type Currency by the = (assignment). ' cCur = cCur Mod 2 generates the same error message ' The following snippets work OK Dim d As Double i = 2 cCur = i ' Demostrates coercion by the = (assignment) d = 1984374978.247863413 cCur = d Mod 16 ' Demonstrates issue is not float vs. integer around Mod End Sub
Confirming with OO 2.1 on WinXP
reassign
STARTED, OOo 2.x
basic and scripting issues now should be assigned to component "scripting"
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Reset assigne to the default "issues@openoffice.apache.org".