Posts: 709
Threads: 104
Joined: Nov 2005
Quote:
Hi Friend,
May be you can use the powerfull commad EXPR.
Example: I have a choose command to select what program to run then execute the program.
//programs definition
PROGRAM2();
PROGRAM3();
...
EXTERNAL PROGRAM1
BEGIN
IF CHOOSE(option,... PROGRAMS LIST... ) THEN
EXPR("PROGRAM"+option+"()"); // will execute PROGRAM2 OR 3 ...
END;
END;
In the PROGRAMx you can create a list to return values to use in the rest of PROGRAM1.
Hope these help You, Best regards!!
jose
Another method:
EXPORT PROGRAM1()
BEGIN
… source code for program 1 …
END;
EXPORT PROGRAM2()
BEGIN
… source code for program 2 …
PROGRAM1(); // run program 1 as the last thing to do inside program 2
END;
This works for any number of programs. All you need to do is make sure to EXPORT each program you wish to use within other programs. They need not be within one source file, either.
Edited: 11 Nov 2013, 7:46 p.m.
Posts: 14
Threads: 8
Joined: Oct 2013
Ok, my friends:
I will follow all these guidelines to view the result.
Thank You
David