To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=52057
Issue #:|52057
Summary:|starbasic:Global of userdefined type gets lost
Component:|framework
Version:|1.0.0
Platform:|PC
URL:|
OS/Version:|Linux
Status:|UNCONFIRMED
Status whiteboard:|
Keywords:|
Resolution:|
Issue type:|ENHANCEMENT
Priority:|P3
Subcomponent:|scripting
Assigned to:|npower
Reported by:|villeroy
------- Additional comments from [EMAIL PROTECTED] Sat Jul 16 02:39:27 -0700
2005 -------
The workaround is: save in in an array.
<<<<<<<<<<<<<<<<BASIC>>>>>>>>>>>>>>>>>>
Option Explicit
Type myObj2
Document
EventListener
End Type
Global aObj(0)
Global oMyObj as myObj2
' Run this routine several times
Sub Main()
Main2()
Main3()
End Sub
Sub Main2
if isEmpty(oMyObj) then oMyObj = createObject("myObj2")
if IsEmpty(oMyObj.Document) then
MsgBox("oMyObj.Document was Empty")
oMyObj.Document = 10
MsgBox("oMyObj.Document now " & oMyObj.Document)
else
MsgBox("oMyObj.Document was " & oMyObj.Document)
oMyObj.Document = oMyObj.Document +5
end if
End Sub
Sub Main3
if isEmpty(aObj(0)) then aObj(0) = createObject("myObj2")
if IsEmpty(aObj(0).Document) then
MsgBox("aObj(0).Document was Empty")
aObj(0).Document = 10
MsgBox("aObj(0).Document now " & aObj(0).Document)
else
MsgBox("aObj(0).Document was " & aObj(0).Document)
aObj(0).Document = aObj(0).Document +5
end if
End Sub
<<<<<<<<<<<<<<<<<END BASIC>>>>>>>>>>>>>>>>>>>>>>>>>>>
---------------------------------------------------------------------
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]