spdfo Newbie

Joined: 29 Oct 2007 Posts: 3
|
Posted: Mon Oct 29, 2007 6:32 am Post subject: problem: assignment of user-defined types |
|
|
Hello, I need help with a basic problem. Where I work we have a tool written in Excel and VBA, that makes heavy use of user-defined types. I am trying to convert it to open office.org, but I encounter very basic problems with user-defined types. One of the problems is assigning between user-defined types. Here is a simple example that works in VBA but not in ooo :
| Code: |
Type myType
s as String
i as Integer
End Type
Sub Main
Dim a(3) as myType
Dim b as myType
a(1).s = "aaa"
a(1).i = 111
a(2).s = "bbb"
a(2).i = 222
a(1) = a(2) ' does NOTHING in ooo
MsgBox a(1).s ' ooo prints 'aaa', VBA 'bbb'
MsgBox a(1).i ' ooo prints 111 VBA 222
a(1).s = a(2).s 'works
a(1).i = a(2).i 'works
MsgBox a(1).s
MsgBox a(1).i
End Sub
|
As you can see, the assignment a(1) = a(2) does nothing in ooo, but works in VBA. Assigning field by field seems to work. Is there a solution for assigning whole types without field-by-field assignment? I am using open office.org 2.3. Please help  |
|