@Jose Cuevas What strikes me with Xojo 2019 is that many error messages are not even remotely related to the actual error. As such, “This item does not exist” may be related to a syntax error, a hidden Unicode character somewhere etc…
It did not work using ParamArray entries() As Pair still get same message.
As in my original post, I put the exact same code as a global function or a class instance method and it works. But not in a shared method.
After testing a bit I tried other shared methods using ParamArray and they do not work on this class. I copied the shared method to another class and it works.
My class name is “types” is a class with helper shared methods and others, manly use to help me bridge data types from Xojo/iOS framework to traditional API.
I found that non of the shared methods work when used from a window event or control (any). But moving the call outside the ui works:
//in module tests
Public Sub callSharedMethod()
//this works
types.test1("name", "jose")
End Sub
In a from PushButton action
Sub Action() Handles Action
callSharedMethod //this works!
// var s as string = types.uid() //gives error
//types.test1("name", "jose") //gives error
End Sub
So the issue is the class name “types”, I searched the docs for “types” to see if there was something in the global scope or similar, but all I found was this enumeration: “Window.Types”, but my impression is that “types” is scoped as verified with this code:
dim t as variant = window.types.Document //this work as expected
dim t as variant = types.Document //this doesnt work as expected
I dont know what im doing wrong or what’s the obscure scope resolution that the compiler is doing, but at least I know to use a different approach.
Thanks for your suggestion, indeed like I posted anything that adds a scope like you mention putting the class in a module or changing the class name works in a window.
The name of the class “types” is what causes the conflict when used inside a window o control, everywhere else it works as expected.
The problem has nothing to do with ParramArray or the use of pair. The scope resolution is resolving “types” to something else in a window/control.