7 ivscriptengine::getscriptvar – Teledyne LeCroy SAS_SATA Tracer_Trainer Automation API Manual User Manual
Page 78

LeCroy Corporation
Automation API for SAS/SATATracer/Trainer
Manual Version 1.11
78
8.1.7 IVScriptEngine::GetScriptVar
HRESULT GetScriptVar (
[in] BSTR var_name,
[out, retval] VARIANT* var_value )
Changes the current verification script name and runs the verification script.
Parameters
var_name
String providing the name of the global variable or constant used
in the running verification script
var_value
Address of a VARIANT variable where the result will be kept
Return values
E_PENDING – if this method is called when the script is already running
Remarks
If there is no such global variable or constant with the name var_name, the resulting
value will contain an empty VARIANT.
Example
C++:
// In this example, we use wrapper functions provided by the #import directive.
ISASTrace* sas_trace;
. . .
ISASVerificationScript* sas_vscript = NULL;
sas_trace->QueryInterface( IID_ISASVerificationScript, (void**)&sas_vscript ) )
assert( sas_vscript != NULL );
IVScriptEngine* sas_vsengine = NULL;
sas_vsengine = sas_vscript -> GetVScriptEngine("Test_1");
assert( sas_vsengine != NULL );
VS_RESULT result = sas_vsengine ->RunVScript();
. . .
VARIANT my_var;
VariantInit( &my_var );
sas_vsengine->GetScriptVar( _bstr_t("MyVar"), &my_var );
if( my_var.vt == VT_BSTR ) ProcessString( my_var.bstrVal );
. . .