Description
- I work with VBScript
- From VBScript I call my first TCL script "name1"
- After the script "name1" is finished, I continue to work with VBScript
- After several VBScript functions I call my second TCL script "name2" and this script is a child process of the script "name1". The script "name2" have to use all variables from the script "name1"
Current result
My scripts "name1" and "name2" are executing in the different tclsh windows As a result, the "name2" is not familiar with the variables of the "name1"
Expected result
"name1" and "name2" are executed in the same tclsh window
Comment
I tried to use these commands but I don't know its syntax in the VBScript
Tcl_Create tclHandler, TCL_Eval Status, tclHandler,
It would be nice to have an example how to use these commands in the VBScript, or any other
Thanks
VBScript:
#$language = "VBScript"
#$interface = "1.0"
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
crt.Screen.Synchronous = True
Sub Main
 dim shell
   set shell=createobject("wscript.shell")
   shell.run "tclsh e:\RunTCL\name1.tcl"
   crt.Sleep 10000 ' or any VBScript commands
   shell.run "tclsh e:\RunTCL\name2.tcl" 
End Sub
name1.tcl
package req SpirentTestCenter
set hProject [stc::create project]
set hTxPort [stc::create port -under $hProject -location //192.168.0.243/10/17 -useDefaultHost False]
name2.tcl
set hRxPort [stc::create port -under $hProject -location //192.168.0.243/10/25 -useDefaultHost False]
New code with tcl84.dll and its commands "TCL_Create tclHandler,":
#$language = "VBScript"
#$interface = "1.0"
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
crt.Screen.Synchronous = True
Sub Main
Dim wscriptTCL 
tclHandler = 0
set wscriptTCL =CreateObject("C:\Tcl\bin\tcl84.dll")
TCL_Create tclHandler, wscriptTCL, 1
puts "Importing STC API"
TCL_Eval Status, tclHandler, "package req SpirentTestCenter"
puts "Creating API objects set"
TCL_Eval Status, tclHandler, "set hProject [stc::create project]"
puts "Connecting to STC ports" 
TCL_Eval Status, tclHandler, "set hTxPort [stc::create port -under $hProject -location //10.110.10.243/8/9 -useDefaultHost False]"
src.Sleep 100000
TCL_Eval Status, tclHandler, "set hRxPort [stc::create port -under $hProject -location //10.110.10.243/8/10 -useDefaultHost False]"
As a result, I see this message: Error:ActiveX component can't create object 'c:\tcl\bin\tcl84.dll'
I can use 2 options:
- Call the tcl file from my VB script
- Call tcl commands from the VB script via dll
But nobody is working
Good news, it starts to work, however, I would prefer to execute separate TCL files by API
  shell.run "tclsh"
  crt.Sleep 10000
  shell.AppActivate "tclsh"
  shell.SendKeys("TCL command")