Is it possible to instantiate my own classes in StarBasic / OpenOffice Basic (not just the OpenOffice API ones)?
How?
And what is the syntax for the constructor in the class?
I have written a working OpenOffice Basic Word .doc HTML converter to convert my uncle's academic research on Byron. Custom code is needed to convert his (many) texts efficiently to the form he wants them in for the Web.
Now I need to use classes to enhance it.
(The code is based on a working VBA converter which uses classes, but can't be further extended due to particular Word VBA bugs admitted by Microsoft.)
I can't get this test class to work:
In document testclass.sxw, in Standard library:
In Module myclass:
Dim mCount as Integer
Sub Inc
mCount = mCount + 1
End Sub
Sub Out
MsgBox "Count is " + Format(mCount)
End Sub
In Module myapp:
Sub Main
Dim test As New myclass REM FAILS WITH ERROR
test.Inc
test.Out
End Sub
The error is 'Object not accessible. Invalid object reference.'
Have tried:
Dim test As New [testclass.sxw].Standard.myclass
Dim test As New Standard.myclass
etc. etc.
... and other things
How?
And what is the syntax for the constructor in the class?
I have written a working OpenOffice Basic Word .doc HTML converter to convert my uncle's academic research on Byron. Custom code is needed to convert his (many) texts efficiently to the form he wants them in for the Web.
Now I need to use classes to enhance it.
(The code is based on a working VBA converter which uses classes, but can't be further extended due to particular Word VBA bugs admitted by Microsoft.)
I can't get this test class to work:
In document testclass.sxw, in Standard library:
In Module myclass:
Dim mCount as Integer
Sub Inc
mCount = mCount + 1
End Sub
Sub Out
MsgBox "Count is " + Format(mCount)
End Sub
In Module myapp:
Sub Main
Dim test As New myclass REM FAILS WITH ERROR
test.Inc
test.Out
End Sub
The error is 'Object not accessible. Invalid object reference.'
Have tried:
Dim test As New [testclass.sxw].Standard.myclass
Dim test As New Standard.myclass
etc. etc.
... and other things