Given
REALarray BassClass_Files(REALobject instance)
{
ClassData(BasClass, instance, BasData, data);
REALLockObject((REALobject)data->files);
return data->files;
}
and the method definition
{ (REALproc) BassClass_Files, REALnoImplementation, "Files as FolderItem()", REALconsoleSafe }
In Xojo you can’t do
for i as integer = 0 to UBound(Basic1.Files)
FileList.AddFolder(Basic1.Files(i).Name)
next
because the compiler says “Too many arguments, got 2, expected 0” for “Basic1.Files(i).Name”. You need to do the following:
for i as integer = 0 to UBound(Basic1.Files)
dim ff() as FolderItem = Basic1.Files
FileList.AddFolder(ff(i).Name)
next
Why? How can you make it happen that the compiler is not getting confused? A different method definition, or add a setter like
{ (REALproc) BassClass_Files, REALnoImplementation, "Files as FolderItem()", REALconsoleSafe },
{ (REALproc) BassClass_SetFiles, REALnoImplementation, "Files(assigns f() as FolderItem", REALconsoleSafe },
?
That does not cut it because Xojo has difficulty to choose which of the two is meant:
FileList.AddFolder(Basic1.Files(i).Name)
“There is more than one item with this name and it’s not clear to which this refers”. Btw, FileList is a Listbox.