Easy to read the code Easy to maintain the code Avoid redundancy and promotes code reuse Various Modularization Techniques Use of Macros Use of include files Subroutines Function Modules Lets look into each of them in detail: To ensure that an input parameter is not changed in the calling program, even if it is changed in the subroutine, you can pass data to a subroutine by value.
A subroutine is a reusable section of code. A subroutine can be defined using Form and EndForm statements.
Positional parameters instead of keyword parameters No genuine input parameters in pass by reference Typing is optional No optional parameters Every subroutine belongs implicitly to the public interface of its program, which is generally not wanted. Function groups encapsulate data.
To pass parameters by value we need to explicitly state it in the subroutine. Blogger Tricks. We will write some code to demonstrate this point. For example.
Infact , there are a large number of standard function Modules available. Function Modules are organized into Function Groups: Note The syntax allows the definition of a subroutine to be split between a declaration part and an implementation part using the statements FORM...
Collections of logically related functions. By using our site, you consent to our Cookies Policy. Then, instead of placing all of the statements in your main program, you just call the module.
You can define the types of the formal parameters of the parameter interface of procedures as internal tables. Join today and follow happsyn. Generally User made Function groups start with "Z".
The formal parameter person is typed with TYPE line. We can call this subroutine in our programs as many times as we wish. R Programming. Recent Posts.