B4J Question [SOLVED] Parameter byref

jroriz

Active Member
Licensed User
Longtime User
Hi.

Is it possible to pass a parameter by reference to a sub?
 

amykonio

Active Member
Licensed User
Longtime User
Hi.

Is it possible to pass a parameter by reference to a sub?

Based on the documentation, no.

From B4xBasicLanguageV1_4.pdf booklet (edition 1.4, Update date: 28/11/2018, page: 56):

In B4X, the parameters are transmitted by value and not by reference.

Andreas.
 
Upvote 0

jroriz

Active Member
Licensed User
Longtime User
That's exactly what I need!
I have a temporary list that I need to manipulate.
Solved!
Thanks.
An object like an aray, map or list can mimic this behavior as you can change its value in the method and it will be changed when it returns from the method.
 
Upvote 0
Top