I noticed the IDE highlights "enum" as a keyword. But it doesn't like the syntax I used. I tried using standard VBA syntax I found on the web as shown below. But the compiler claims it is expecting a sub at the enum keyword. Did they reserve all keywords used by VBA without implementing some?
I can't answer your problem in any detail, but you are making a fundamental error in assuming that OpenOffice recognises and honours VBA syntax. The language used is completely different. You need to look at the documentation in detail. Start with OpenOffice BASIC programming Guide
and the API info linked off http://www.openoffice.org/api/
Hagar Delest wrote:Plenty of topics with enum in the macro section and the code snippet.
See for example: Close all opened Writer documents.
Please add '[Solved]' at the beginning of your first post title (edit button) if your issue has been fixed.
I don't think Will is referring to enumerations of UNO objects, though they are highly useful; I think he wants a named list. I don't think OOBasic implements that directly, though with a certain amount of awkwardness something similar can be done with Array().
The primitive StarBasic language does not know any enums. Any mature programming language (Java, Python, JavaScript, ...) knows some type of key:value pairings.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Villeroy wrote:The primitive StarBasic language does not know any enums. Any mature programming language (Java, Python, JavaScript, ...) knows some type of key:value pairings.
Figures. So why does it treat "enum" as a keyword when it comes to syntax highlighting?
Will Pittenger
I currently use OpenOffice 4.0 32-bit on Windows 7 64-bit (as of August 7th, 2013)
It is a know fact that it is possible to activate VBA support in Star Basic. It is not clear to me if it a good habit to activate it but for old VBA programmers who really understand that language and also can program maybe it is good to do it. But this group programmers is small.