Discussion
In and Out Parameter in Activity
What is the basic difference between In/Out parameter in an activity.I was trying to get the difference but it seems there is no difference between these two kind of parameters.I can use Out paramete in place of In parameter and vice versa.Please let me know if anyone has information about the difference between In/Out parameter.Let me the real life scenario where i can use Out parameter and also let me know the case where if i am using Out parameter in place of In parameter or vice versa then i will get error.
If there is no difference between these two then what is the significance of keeping it in Parameter tab in activity.I tried all the scenario and i can use In inplce of Out and Out in plcae of In and i cant see any difference.So i wanted to know more about this.Please let me know if anyone has any idea on this.
Thank you.
Parameter names are not properties, and are not defined by a property rule:
Recording an activity's outputs or results on the parameter page is only useful when the parameter page is passed into this activity by reference, using the Pass current parameter page? checkbox in the Call instruction. When checked, one parameter page is shared between the calling and called activity. Otherwise, parameters on the called activity's parameter page are not available to the calling activity after a return.
The Call instruction in an activity examines the In/Out value of each parameter in the called activity:
If the parameter is declared as Out and the entire parameter page of the current activity is shared with the calling activity, then the value of the Out parameter in the call may be of the form param.name. If the called activity updates the output parameter, the resulting value is available on the parameter page of the calling activity.
If a parameter is declared as Outand the value of the parameter in the Call panel is itself a property reference, then traditional call-by-reference semantics applies. That is, if the called activity updates the parameter value, the value of the property itself is updated.
Accordingly, do not list a local variable as the destination for an Out parameter. Do not pass a parameter reference as the destination for an Out parameter, unless passing the entire parameter page.
In a chain of calling activities (activity Alpha calls Beta which calls Gamma), a property passed by reference from Alpha to Beta can also be passed by reference to Gamma, and changes to the Out parameter made within Gamma can be passed all the way back to Alpha. This corresponds to the behavior of call-by-reference in many programming languages.