Error: window1.btnLoadFiles.Action, line 18:
There is more than one method with this name but this does not match any of the available signatures.
ListBox1.CellValueAt(ListBox1.LastAddedRowIndex, ColumnIndexNbr.NameOfFile) = file.Name
I have determined the error is exactly with the implementation of the ColumnIndexNbr.NameOfFile and I have given this countless endless names which are most certainly unique. They do not exist anywhere else in the code, only in the enumeration.
What’s most stupid is, a) they are defined as integers, and yet, if I cast it to an integer, it works!
Here is the definition of my enum:
Enum ColumnIndexNbr As Integer
idxNumber
DateTime
Size
NameOfFile
End Enum
The code that doesn’t work:
ListBox1.CellValueAt(ListBox1.LastAddedRowIndex, ColumnIndexNbr.NameOfFile) = file.Name
Code that does work:
ListBox1.CellValueAt(ListBox1.LastAddedRowIndex, 3) = file.Name
ListBox1.CellValueAt(ListBox1.LastAddedRowIndex, Integer(ColumnIndexNbr.NameOfFile)) = file.Name
According to ListBox (deprecated) — Xojo documentation CellValueAt takes an integer in it’s second argument and when I pass in an integer directly, it works. However, the enum that is also an integer is being treated as though it’s a duplicate item of something else, but I can’t figure out what.
The error message is totally useless. The idea of me using an enum in this situation is when I later change the position of the columns or add new columns, I can do so without messing up connections, but I just can’t get the enum to work. I suppose I could just create random constants (I will do that for now), but if someone knows why I am getting this error, it would be much appreciated
PS: in coming with. title for this question I realise it’s treating what I am entering as a method and not an enum, but I still don’t know how to fix that