In addition to the excellent suggestion of using a "secret" parameter or
option in the calling Execs, you could also set a "secret" GLOBALV
variable in the calling Execs and retrieve it in the called Exec. For
example, EXECA and EXECB both call SUBEXEC:
Code in EXECA and EXECB:
Parse Source . . myname .
'GLOBALV SELECT SUBEXEC SET CALLEDBY' myname
'EXEC SUBEXEC parms (options'
Code in SUBEXEC:
'GLOBALV SELECT SUBEXEC GET CALLEDBY'
'GLOBALV SELECT SUBEXEC SET CALLEDBY' /* Clear CALLEDBY Variable */
If calledby = '' Then
... Called from Command Line
Else
... Called from Other Exec
An advantage to using GLOBALV is that you don't have to change your
parameter/option parsing logic and if you need to know which Exec called
SUBEXEC, then the calling Exec name is in "calledby".
--
Dale R. Smith
"Give a man a computer program and you give him a headache, but teach
him to program computers and you give him the power to create headaches
for others for the rest of his life."
- R. B. Forest