We have CallSub, CallSub2 and CallSub3 for no parameters, 1 parameter and 2 parameters respectively. There are examples on the forum advocating passing parameters as types, arrays and objects to avoid the parameter limit.
I have been passing 3 or 4 parameters to a sub without any problem - because I group all my subs into modules, where there seems to be no limit. For instance:-
The return is an array of byte arrays, which appears to be passed by value, but it may be by reference to multiple copies of the same-name object in the sub. I have modules for such things as numeric manipulation, string manipulation, data preparation, and so on, all containing subs with multiple input parameters.
My concern is that, apart from being frowned on (though I cannot see why), I may be introducing some instability or unreliability into the code.
Is my approach sound practice, or should I change my ways?
I have been passing 3 or 4 parameters to a sub without any problem - because I group all my subs into modules, where there seems to be no limit. For instance:-
B4X:
Dim AllTrigArgs As Object = TrigArgsNew.ByteArgs(NameStr(I), dRows(I), dLen(I), True)
The return is an array of byte arrays, which appears to be passed by value, but it may be by reference to multiple copies of the same-name object in the sub. I have modules for such things as numeric manipulation, string manipulation, data preparation, and so on, all containing subs with multiple input parameters.
My concern is that, apart from being frowned on (though I cannot see why), I may be introducing some instability or unreliability into the code.
Is my approach sound practice, or should I change my ways?