[in] ViStatus variable to test.
ReturnOnError Macro
Returns from the current function using the supplied status parameter as the return value, if that parameter represents a failure status.
Syntax
Section titled “Syntax”#define ReturnOnError(status)Parameters
Section titled “Parameters”status
Remarks
Section titled “Remarks”This macro is useful for organizing a series of function calls that use ViStatus values as their return codes. It allows code to be written more “linearly”, as opposed to using a series of nested if-else constructs.
Example
Section titled “Example”The following example demonstrates use of the ReturnOnError macro.
ViStatus _VI_FUNC acme4321_ConfigureSweep(ViSession Vi, ViReal64 StartFrequency, ViReal64 StopFrequency){ // ...
auto status = VI_SUCCESS;
status = viPrintf(GetVisaSession(Vi), "CONFIG:SWE %0.15lg,%0.15lg\n", StartFrequency, StopFrequency); ReturnOnError(status);
// ...}