How to read and write INI files using LibreOffice BASIC?

I am trying to convert a VB program into LibreOffice BASIC.
Is there a macro that reads INI files?
Can a function be used by calling the Windows API?

The most of the .ini files are pure .txt files really.
.
You can handle them in this way
.
https://help.libreoffice.org/latest/ro/text/sbasic/shared/03020301.html?&DbPAR=SHARED&System=WIN
.
https://help.libreoffice.org/latest/ro/text/sbasic/shared/03020200.html
.
https://wiki.openoffice.org/wiki/Documentation/BASIC_Guide/Files_and_Directories_(Runtime_Library)

There is the old BASIC-FAQ by Dannenhöfer (german language)
Check 10.3.33 ReadIni
and 10.3.34 ReadIni
(“Bereich” translates to “range”, I guess this adresses sections in the ini-file)

http://www.dannenhoefer.de/faqstarbasic/ToolsvomDannenhfer.html

Here’s another set of VBA macros that don’t use the Windows API: VBA – Read Write INI Files.

Hello,

I’ve written a class that handles ini-file reading and writing (with sections management and more).

I use it in a few of my extensions. To have a look at it and see it in context, download the TheCAT extension here.

If you don’t want to install it, just extract the oxt and find the code in the TheCAT subdir. There, you’ll find the IniClass module where the class is declared and the Settings module where it is actually used.