Sub Process_Globals
Type MyPoint (X As Int, Y As Int, Clr As Int)
End Sub
Sub PrintPoint (p As MyPoint)
Log(p.X)
End Sub
Sub SomeSub
Dim p As MyPoint
p.X = 100
p.Y = 200
CallSub2 (Me, "PrintPoint", p)
End Sub
You can also create a helper sub:
B4X:
Sub CreatePoint(X As Int, Y As Int, Clr As Int) As MyPoint
Dim p As MyPoint
p.Initialize '<-- not required in this case but it is still a good practice.
p.X = X
...
Return p
End Sub
CallSub2(Me, "PrintPoint", CreatePoint(100, 200, Colors.Red))