You need to pass an instance of the type that already contains the required values. If you have a CreateType Sub you could use that
B4X:
Type MyType (Item1 As Int, Item2 As Int)
...
Public Sub CreateMyType (Item1 As Int, Item2 As Int) As MyType
Dim t1 As MyType
t1.Initialize
t1.Item1 = Item1
t1.Item2 = Item2
Return t1
End Sub
...
Sub Temp(Input As MyType)
Dim x, y As Int
x = Input.x
y = Input.y
End Sub
...
Temp(CreateMyType (3,4))
Not sure if I need to start a new thread, but I have a related question. @agraham, when using your reflection library, is it possible to pass Custom Types as arguments in RunMethod2? For example:
B4X:
Type Coordinates (x As Int, y As Int)
Dim cellCoordinates As Coordinates
Dim refView As Reflector
Dim SomeView, v As View
SomeView.Tag = cellCoordinates
.
.
refView.Target = Activity
v = refView.RunMethod2("FindViewWithTag",
cellCoordinates, <--needs to be string?
"lang.java.<?>" <--what type?