I remember at one time in RB one could not return multi-dimentional but I thought that changed…
I am pretty sure I have returned 2D arrays from a method at some point in the past… but I could be wrong… So is it it supported and if so should it be defind like this?
Function Test() As Picture(,)
'some code
End Function
If not how should it be defined?
Or has a bug crept in at some point?
When I put the above on the default window I get the error:
Window.Name This type conversion may only be implemented for one dimentional arrays
The error message is obviously a bug as the error (if there is one) should me on the Method “test”, not the Window. Also I don’t know what type conversion it is taking about…
You can’t return 2D arrays of Object type from Windows or Classes. They do work from Modules though. My <https://xojo.com/issue/26312> has been closed as not reproducible long ago. Not sure why they couldn’t see it.
However with an array of Pictures it gives the message “this type conversion is only implemented for one-dimensional arrays”
So it seems to only be 2d arrays of object that have this issue
Yeah its curious as from what I can see just the method existing on the window is all it takes.
You never have to call it - it just has to exist.
And it does seem to only be a 2d array of object types - I’ve not seen if there are any that do work - that would be really odd if Pictures don’t but Dates do.
[quote=165567:@Will Shank]Yes, simply defining the method triggers the error…
New desktop project
Add this method to Window1
Sub Untitled() As Object(,)
End Sub
Analyze project -> error “Window1.Name” - This type conversion is only…
Notice it mentions “Window1.Name” as the source of the error, not the methods name. ??[[/quote]
Thats really an issue with not being able to show you the internal code for a Window
Enums ar basically integers so not surprising
Structures aren’t objects so they’re more like integer etc
It’s a bug in the compiler. The IDE is showing the location as Window1.Name because the compiler is basically saying there’s an error on the first line of the Window1 class.