To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=83143
User bmarcelly changed the following:
What |Old value |New value
================================================================================
CC|'' |'bmarcelly'
--------------------------------------------------------------------------------
------- Additional comments from [email protected] Fri Feb 27 19:32:00
+0000 2009 -------
There is an easy work-around : use a function to declare the array, and use
variant
instead of the user type.
In the following example, run the macro Main:
Type myType
s as String
i as Integer
End Type
Function initMyType(maxIdx As Long) As Variant
Dim t(maxIdx) As myType
initMyType = t
End Function
Sub Main
Dim a As Variant
a = initMyType(0) ' defining an array of 1 element
a(0).s = "hello"
a(0).i = 123
print a(0).i, a(0).s
a = initMyType(100) ' redefining as an array of 101 elements
a(100).s = "good bye"
a(100).i = 456
print a(100).i, a(100).s
End Sub
Another advantage is that the routine Main can be in another module, or even in
another library.
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]