Dim statement strange behaviour

I have noticed some strange effects caused by a Dim statement in a macro.
When I define:

Dim debetTotaal, creditTotaal As Currency

the first field is a variant and the second field is a currency field, when i look in the watch fields.
However, when I define:

Dim debetTotaal As currency
Dim creditTotaal As Currency

both fields are shown as currency fields.

In some cases the first variant caused wrong results (not equal) when I had to compare the contents of the fields although the contents were equal.
(libreoffice 24.2.1.2 Ubuntu)

Look at Dim Statement
for example Dim v1, v2, v3 As String - first ones get defined as Variant variables.

2 Likes

I know it sounds stupid, but I never knew this!