How to call subs with 3 or more parameters

DOM85

Active Member
Licensed User
Longtime User
Hi,
In "Sub" example (documentation) i see :
Example:
Sub MySub (FirstName As String, LastName As String, Age As Int, OtherValues() As Double) As Boolean
...
End Sub

But how to call a such sub since the max number of parameters is 2 with callsub3 ?

Thanks
 

DOM85

Active Member
Licensed User
Longtime User
You will need to change the sub signature or create another one that will delegate to this sub.
You can use a custom type to pass all the variables:
B4X:
Type MySubType (FirstName As String, LastName As String, Age As Int, OtherValues() As Double)

And then declare the sub:
B4X:
Sub MySub (v1 As MySubType)

Hi Erel,
Perfect!!
Thank you.
 
Upvote 0

hdtvirl

Active Member
Licensed User
Longtime User
How is mySub called.

Thank Erel, for this answer, how is MySub called ?, can you give an example please.

Regards

BOB
 
Upvote 0

hdtvirl

Active Member
Licensed User
Longtime User
Thanks

Erel, that works great, that example sorted a small issue I had, I thought the original problem was created by me through my lack of knowledge and expereince and the original post proved me right I was at fault !!.

Thanks again to DOM85 for asking the original question.

Regards

BOB.

A mistake is always a mistake is nothing is learned from it !!!.
 
Upvote 0
Top