beautypg.com

Teledyne LeCroy UWBTracer Automation Manual User Manual

Page 66

background image

LeCroy

UWBTracer Automation API Reference Manual

Manual Version 3.02

62

Example


C++: // In this example we use wrapper functions provided by #import directive
//
IUwbTrace*

uwb_trace;


. . .

IUwbVerificationScript* uwb_vscript = NULL;

uwb_trace->QueryInterface( IID_ IUwbVerificationScript, (void**)&uwb_vscript ) )

assert( uwb_vscript != NULL );

IVScriptEngine* uwb_vsengine = NULL;
uwb_vsengine = uwb_vscript -> GetVScriptEngine("Test_1");
assert( uwb_vsengine != NULL );

VS_RESULT result = uwb_vsengine ->

RunVScript

();

. . .

VARIANT my_var;

VariantInit( &my_var );

uwb_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 MyVar contains

an integer

MyStrVar = VSEngine.GetScriptVar( "MyStrVar" ) ' Let's suppose that MyVar contains

a string


MsgBox " MyIntVar = " & CStr(MyIntVar) & ", MyStrVar = " & MyStrVar