Problems with ReadDirectories() in 'LibreOffice'>'Tools'>UCB'

I copied this code from ‘LibreOffice Macros & Dialogs’ > ‘Tools’ > ‘UCB’ > ‘Main’

Sub Main()
Dim LocsfileContent(0) as String
	LocsfileContent(0) = "*"
	ReadDirectories("file:///space", LocsfileContent(), True, False, false)
End Sub

The first problem with this code is the order of the parameters in ReadDirectories() is not correct. If you look at ReadDirectories() you see that the order is:

ByVal AnchorDir As String, 
bRecursive as Boolean, 
bcheckFileType as Boolean, 
bGetByTitle as Boolean, 
Optional sFileContent(), 
Optional sExtension as String

Mapping the parms gives:

AnchorDir = "file:///space"

bRecursive = LocsfileContent() This is incorrect

bcheckFileType = True

bGetByTitel = False

sFileContent = false This is incorrect

The parameter sFileContent() (LocsfileContent()) should be last not second. Once I discovered this I was able to get ReadDirectores to work. The next problem I found is Directory names that end in a space (allowed on the Mac not in Windows) are not handled correctly. If the Directory name ending with a space happens to be the AnchorDir the function returns a message that the directory does not exist. If the Directory name ending with a space is in a subdirectory (bRecursive = True) the files in the directory are skipped with no message indicating that something was amiss.
The last problem is Function ReadDirectores() works sometimes and other times it returns an error message ReadDirectores() not found. I am unable to determine why it works sometimes but not always.
Has anybody else tried to use this function?

I ran my code on a Mac today and found that on the Mac folders with names that end in a space are handled correctly. My comment only applies to Windows. Since folder names ending in a space are not allowed in Windows one can say that the ReadDirectories() worked correctly. An error indication of these directories found in subfolders would be nice when run on Windows. But that is a nit.
The mix up in the parameter list in the sample Main code is still an error that should be corrected for those of us who are just learning LibreOffice Basic. Seasoned programmers would have seen it right away. I consider this solved now.