Is there a reference or resource for Basic code for macros (to be used in Base)?

I don’t know if this is a good idea, but I’d like to try it if possible. I used to work on this kind of stuff years ago before I retired, but I have forgotten most of the specifics through lack of use. And I guess that there is a specific flavor of Basic used in LibreOffice macros.

I have been freely and quickly given help on macros here, but I don’t want to keep coming back for help on variations a la Columbo “Oh, just one more thing.” Now that I have a couple of macros as examples, I would really like to be able to at least try to figure out variations on my own, how the syntax works, and so on.

That is why I am hoping there is an online reference or a book or something where I could look things up and maybe begin to teach myself a little.

The StarBasic language and its IDE is (almost) fully documented in the help files but not the objects you can talk to in that language.
The best documentation on the overall concepts is still Apache OpenOffice Developer's Guide - Apache OpenOffice Wiki (on API level LibreOffice is mostly the same as OpenOffice).
You can access the Universal Network Objects (UNO) which make up the API of this office suite through various languages. You are not limited to the crappy Basic dialect that is shipped with LibreOffice.
You can use Python, JavaScript, Java, C++ to extend UNO.
You can write macro scripts in Python, JavaScript and “Bean Shell” (interpreted Java).
On Windows you can also use the bundle of objet oriented languages provided by the that unified platform (C#, VB etc.)
Best reference for Java programmers: http://fivedots.coe.psu.ac.th/~ad/jlop/#contents.
Best reference for StarBasic programmers: www.pitonyak.org/oo.php
You need weeks, if not months, before being creative within that framework. A mandatory helper is the MRI object inspection: [Tutorial] Introduction into object inspection with MRI which allows you to look up every property and method and every derived objet of a given object.

Which btw is also available in the TDF wiki LibreOffice Developer's Guide - The Document Foundation Wiki .

Writing any macros is the most serious mistake when starting with Base. You get nothing finished when your first project relies on macro code. I use Base since 14 years on a daily basis. Most of our office documents are connected to some Base document one way or the other. I use no more than may be 50 lines of Python code. Without any macro at all our documents would still work with a few more clicks. It is absolutely vital that your relational databases are well normalized. It is possible to create rather complex input forms and reports for one-to-one, one-to-many and many-to-many relations without a single line of macro code. The Base related part of the UNO API is even more complicated than APIs for Writer and Calc.

Download OpenOffice.org Macros Explained, the last reference in Macro Guides | LibreOffice Documentation - LibreOffice User Guides

Visit Andrew Pitonyak’s web page

for other information.

btw There are also Java and Python resources elsewhere.

And also, special for Base: Have a look at the Base Guide. There are more than 100 pages about special macros used in Base. Base Handbuch in German Documentation has a bit more examples, but won’t be translated to English again.

All guides could be downloaded here: English documentation | LibreOffice Documentation - LibreOffice User Guides .
There is also a special Base Macro book from Andrew Pitonyak. Have a look on his web page - see linkf from @flywire

Thank you both. Both replies very helpful.