I hope to explain the problem well enough by exposing a concrete example that happened to me just yesterday.
I have a routine in an Activity that receives two parameters. When I invoke it from within the Activity itself, I simply use: RoutineName(Param1, Param2).
I also called it from a service module and also using CallSubDelayed again from within the Activity.
I needed to modify that routine by adding a third parameter but CallSubDelayed3 can be used to pass two arguments only, as you know.
The only solution that came to my mind was to use a single Map parameter, but this implies some problems.
1) change a lot of code already created (in this case);
2) you must remember the number and types of arguments to add to the Map;
3) the compiler is unable to tell you that you are wrong about the arguments you're passing;
4) the readability of the code is lost a lot;
5) you no longer have the possibility to use the useful F7 directly on the name of the parameter (you will have to use variables inside the routine, immediately at the beginning, and you can press F7 on these, anyway)
I don't know if creating a CallSubDelayed4 (and CallSub4) that allows you to send an unlimited number of arguments is very complicated to implement or this can create backward compatibility problems (this probably not).
I obviously hope this will be done.
I have a routine in an Activity that receives two parameters. When I invoke it from within the Activity itself, I simply use: RoutineName(Param1, Param2).
I also called it from a service module and also using CallSubDelayed again from within the Activity.
I needed to modify that routine by adding a third parameter but CallSubDelayed3 can be used to pass two arguments only, as you know.
The only solution that came to my mind was to use a single Map parameter, but this implies some problems.
1) change a lot of code already created (in this case);
2) you must remember the number and types of arguments to add to the Map;
3) the compiler is unable to tell you that you are wrong about the arguments you're passing;
4) the readability of the code is lost a lot;
5) you no longer have the possibility to use the useful F7 directly on the name of the parameter (you will have to use variables inside the routine, immediately at the beginning, and you can press F7 on these, anyway)
I don't know if creating a CallSubDelayed4 (and CallSub4) that allows you to send an unlimited number of arguments is very complicated to implement or this can create backward compatibility problems (this probably not).
I obviously hope this will be done.
Last edited: