‎2014 Feb 11 3:39 PM
Hi Experts,
Is there any limit on how many subroutines should be used in program?
Like if particular no. of FORM..ENFORM is increased then it will affect the performance of the program.
Regards,
Sanjana
‎2014 Feb 11 4:19 PM
If a program takes half second extra to execute, but it saves 15 minutes during analysis because it is easier to read, it is a good deal overall.
So keep modularizing unless there is definitive proof that performance is getting affected.
‎2014 Feb 11 4:47 PM
Hi,
I am using this opportunity to ask about minimizing global variables usage and using typed
parameters and local variables instead ?
Regards.
‎2014 Feb 11 4:53 PM
‎2014 Feb 11 4:58 PM
hi sanjana,
subroutines main aim is reusability...if the code is more than a time in your report.. you can put it in a subroutine to reduce the report size...the subroutine never effects the program if u call any number of times....its the code which you write inside the subroutine is simple and fast it will not affect the program... if the code inside the subroutine is making access of big tables to fetch data then surely the perfomance will degrade if u call this subroutine a number of times...
thanks
gunaseelan
‎2014 Feb 11 6:34 PM
How about creating a method of a class and use (instance or static based on the requirement)?