Posted: 26 Feb 2015 17:49 EST Last activity: 2 Mar 2015 10:38 EST
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.
Parameter names are not properties, and are not defined by a property rule:
If the parameter is an output (result) of the activity, your activity can set values for it using the Property-Set method with the Param keyword followed by the parameter name. (The parameter page is available to the calling activity only when the Pass current parameter page? checkbox is selected in the Call instruction.)
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.
Hi..thank for the response...but these details i have already gone through in the help topics.....What you are saying i understand that ..by my question is i can use OUT or IN parameter both in all scenario like even if u passing by reference or by value...there is no specific scenario where if you are passing IN inplace of AND you will get error...there is basically no differnece between IN/OUT because it does not matter if you are keeping it IN/OUT ...you can use any one of this