This script can be run from a "parent" Procomm window and will launch two "child" Procomm windows that can be controlled via DDE (in this case, each child window is told to run a different script):
proc main
string pathname
integer pwhwnd1, pwhwnd2
long pwchanid1, pwchanid2
pathname = $pwtaskpath ;Get Procomm's path.
addfilename pathname "PW5.EXE" ;Add Procomm's EXE.
if run pathname ;Run the program.
pause 5
pwhwnd1 = $mainwin ;Get the active window ID.
if run pathname
pause 5
pwhwnd2 = $mainwin
if ddeinit pwchanid1 "PW5" "System" pwhwnd1 ;Establish DDE connection with first instance.
ddeexecute pwchanid1 "EXECUTE HINTS.WAX"
else
errormsg "Error initializing DDE channel"
endif
if ddeinit pwchanid2 "PW5" "System" pwhwnd2 ;Establish DDE connection with second instance.
ddeexecute pwchanid2 "EXECUTE HOSTUTIL.WAX"
else
errormsg "Error initializing DDE channel"
endif
endif
else ;Problems running program.
errormsg "Error running %s" pathname
endif
endproc
Now, the script above will let your parent script push values to the child scripts via the ddepoke command. If you wanted to go the other way (the child scripts requesting updated variable information from the parent script), I think it is possible but it may require the parent script passing the proper values for the ddeinit command to the child scripts (so that the child scripts can setup a DDE connection back to the parent script).
In the sample above, the ASPECT environment is not shared (due to the run command being used), so the child scripts and parent script cannot share values of the predefined global variables.
aspect@aspectscripting.com