Question
Avaya india pvt.ltd
Avaya india pvt.ltd
IN
Avaya india pvt.ltd
Posted: Mar 17, 2017
Last activity: Mar 21, 2017
Last activity: 21 Mar 2017 2:50 EDT
Closed
Solved
Difference between parameters and localvariable
Can someone explain me the difference between parameters and local variable with example?
Hi,
I am believing that you have Idea about c/java. I can explain in that way.
Example of a function in C/Java
int add( int a, int b ) { int sum; sum = a + b; return sum; }So if you observe the above function ; it is expecting a and b values(Parameters of mentioned function). and inside the function there is another variable which is sum.
If we compare same thing with pega ; a and b variables are like parameters (created for reusability by passing values dynamically). And sum is like Local variable. The scope of that variable is up to that function (Local to that function). In pega the scope of local variable is up to the rule. It will be useful for manipulations within the steps of the rule. There is no scope for local variables after out of the rule.