Ivscriptengine::setscriptvar – Teledyne LeCroy SAS_SATA Automation API manual User Manual
Page 130

Teledyne LeCroy
SASVScriptEngine Object
124
Automation API for Teledyne LeCroy SAS/SATA Protocol Suite
IVScriptEngine::SetScriptVar
HRESULT SetScriptVar (
[in] BSTR var_name,
[in] VARIANT var_value )
Allows you to set the value of some verification script global variable before/after
executing the script (refer to the SASTracer Verification Script Engine Manual and the File
Based Decoding Manual for information on how a script can declare, set, and use global
variables).
Only integers, strings, or arrays of VARIANTs are allowed as correct values. Arrays of
VARIANTs are converted into list values inside of scripts. See the File Based Decoding
Manual for more details about list objects.
Parameters
var_name
String providing the name of the global variable used in the
running verification script
var_value
VARIANT variable containing the new variable value
Return Value
E_PENDING
If this method is called when the script is already running
Remarks
This function allows you to set internal script variables before running a script, giving you
the opportunity to make run‐time customization from COM/Automation client
applications.
For this operation to take effect during execution of the script, a global variable with the
name specified by var_name should be declared by the script.
Example
C++:
// This example uses 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 );