2007 Dec 18 6:34 AM
I wanted to know the difference between the parameters present in the perform and parameters present in the form statement using and changing options that r mentioned in form.
2007 Dec 18 6:39 AM
Under USING we specify those parameters whose value will b needed in the PERFORM for say som calculation etc..but itself wont be changed during these operations..its value will b used n not changed..
while under CHANGING v specify those parameters whose value cud b changed during the operations in th PERFORM.it will hav som value while being passed..however by the end of PERFORM operations it wud be changed unlike the USING parameters
Hope dis helps..
Reward if it does
I wanted to know the difference between the parameters present in the perform and parameters present in the form statement using and changing options that r mentioned in form.
2007 Dec 18 6:39 AM
Under USING we specify those parameters whose value will b needed in the PERFORM for say som calculation etc..but itself wont be changed during these operations..its value will b used n not changed..
while under CHANGING v specify those parameters whose value cud b changed during the operations in th PERFORM.it will hav som value while being passed..however by the end of PERFORM operations it wud be changed unlike the USING parameters
Hope dis helps..
Reward if it does
2007 Dec 18 6:43 AM
Hi,
These additions define formal parameters parameters. Formal parameters can be used in the subroutine as data objects on all operand positions that match their typing and their changeability defined by USING or CHANGING.
When you define the formal parameters parameter, you have the option of defining either pass by reference or value. The effect of this definition for formal parameters defined with USING and CHANGING is as follows:
Pass by reference for USING parameters
For the formal parameters p1 p2 ..., no local data object is created in the subroutine. Instead, when it is called, a reference is passed to the specified actual parameter. A change to the formal parameter in the subroutine also changes the value of the actual parameter.
Pass by reference for CHANGING parameters
The formal parameters p1 p2 ... are handled exactly like those parameters defined for pass by reference using USING.
Pass by reference for USING parameters
For each formal parameter p1 p2 ..., a local object with the same data type as the corresponding actual parameter is created in the subroutine and filled with its values. A change to the formal parameter in the subroutine does not change the value of the actual parameter. The actual parameter also retains its original value even after the subroutine has ended.
Pass by reference for CHANGING parameters
For each formal parameter p1 p2 ..., a local data object with the same data type as the corresponding actual parameter is created in the subroutine and filled with its values. A change to the formal parameter in the subroutine does not directly change the value of the actual parameter. If the subroutine is ended using ENDFORM, RETURN, CHECK or EXIT however, the content of the formal parameter is assigned to the actual parameter. If the subroutine is ended by a message or an exception, the actual parameter remains unchanged.
Plzz reward points if it helps.