Example, Ipetrace* pe_trace, Ipeverificationscript* pe_vscript = null – Teledyne LeCroy Automation API for Teledyne LeCroy PETracer_PETrainer User Manual
Page 130: Result = vsengine.runvscript

Teledyne LeCroy
Automation API for PETracer/PETrainer
125
Example
C++:
// In this example we use wrapper functions provided by #import directive
//
IPETrace* pe_trace;
. . .
IPEVerificationScript* pe_vscript = NULL;
pe_trace->QueryInterface( IID_IPEVerificationScript, (void**)&pe_vscript ) )
assert( pe_vscript != NULL );
IVScriptEngine* pe_vsengine = NULL;
pe_vsengine = pe_vscript -> GetVScriptEngine("Test_1");
assert( pe_vsengine != NULL );
VS_RESULT result = pe_vsengine ->
RunVScript
();
. . .
VARIANT my_var;
VariantInit( &my_var );
pe_vsengine->GetScriptVar( _bstr_t("MyVar"), &my_var );
if( my_var.vt == VT_BSTR ) ProcessString( my_var.bstrVal );
. . .
WSH:
. . .
Set Trace = Analyzer.OpenFile( TraceName ) ' Open the trace
Set VSEngine = Trace.GetVScriptEngine( VScript ) ' Get VS Engine object
Result = VSEngine.RunVScript
MyIntVar = VSEngine.GetScriptVar( "MyIntVar" ) ' Let's suppose that MyIntVar contains an
integer
MyStrVar = VSEngine.GetScriptVar( "MyStrVar" ) ' Let's suppose that MyStrVar contains a
string
MsgBox " MyIntVar = " & CStr(MyIntVar) & ", MyStrVar = " & MyStrVar