Issue 74147 - Mod with Currency generates type mismatch
Summary: Mod with Currency generates type mismatch
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: scripting (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows XP
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-03 05:34 UTC by catkin
Modified: 2017-05-20 11:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description catkin 2007-02-03 05:34:56 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
Comment 1 kpalagin 2007-02-04 13:26:32 UTC
Confirming with OO 2.1 on WinXP
Comment 2 noel.power 2007-02-05 10:22:31 UTC
reassign
Comment 3 ab 2007-02-20 12:51:23 UTC
STARTED, OOo 2.x
Comment 4 Mathias_Bauer 2007-12-04 14:57:37 UTC
basic and scripting issues now should be assigned to component "scripting"
Comment 5 Martin Hollmichel 2007-12-07 12:13:42 UTC
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Comment 6 Marcus 2017-05-20 11:27:40 UTC
Reset assigne to the default "issues@openoffice.apache.org".