There are several ways to accomplish this. Here is a method that I use.
First, I determine the Process ID of the TCC.EXE that I am using. I do this with a function;
Code:
CurrentPID=%@strip[*,%@word[0,%@execstr[tasklist tcc | findstr "*"]]]
Next, I store the CurrentPID into an environment variable;
Code:
set _CurrentPID=%@Currentpid[]
From my .EXE, I obtain the value of environment variable
_CurrentPID, then use the TCC
SETP command to set an environment variable in TCC;
Code:
#COMPILE EXE
#DIM ALL
FUNCTION PBMAIN () AS LONG
DIM TCCPID AS STRING
DIM Command2Run AS STRING
DIM TCCRT AS STRING
TCCRT="C:\Program Files\JPSoft\TCC_RT_24\tcc.exe"
TCCPID=ENVIRON$("_CurrentPID")
? TCCPID
Command2Run=TCCRT + " /C setp " + TCCPID + " FromEXE=Test"
SHELL Command2Run
END FUNCTION
When the .EXE is finished running, I have a new environment variable,
FromEXE, with the value
Test.
There are other methods to accomplish this, but this works best for me.
Joe