View previous topic :: View next topic
|
Author |
Message |
khaarthikm
New User
Joined: 08 Aug 2005 Posts: 15
|
|
|
|
Hi,
Is it possible to pass a variable declared inside a procedure to another procedure.
PROC1: PROCEDURE;
DCL A CHAR(20);
A = 'ABC';
CALL PROC2;
END PROC1;
PROC2: PROCEDURE;
PUT SKIP LIST('Value from PROC1' !! A);
END PROC2;
Now I get a compiler warning that A is implicitly declared.
Kindly help. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Why do you think it's called an internal variable?
If you want to pass it around, you'll have to use
Code: |
PROC1: PROC;
DCL A CHAR(20);
A = 'ABC';
CALL PROC2(a);
END PROC1;
PROC2: PROC(b);
dcl b char(*);
PUT SKIP LIST('Value from PROC1' !! b);
END PROC2; |
|
|
Back to top |
|
|
|