Share this page

# lr.scenario_id

Returns the id of the current scenario or session step.

## C# Language

    int lr.scenario_id();

## VB.NET

    Function lr.scenario_id( ) as Integer

Informational Functions

## Arguments

No arguments.

The lr.scenario_id property returns the current scenario or session step ID.

To access the scenario ID, add the scenario attribute to the runtime settings. Add scenario to the Additional Attributes on the General tab. If the scenario attribute is not added to the runtime settings, the scenario ID is always zero (0).

## Return Values

The scenario or session ID. If no value is available,returns -1.

## Parameterization

Parameterization is not applicable to this function.

## Example

The following example retrieves the scenario ID, checks its validity, and sends it to the output.

    scenarioid= lr.scenario_id;if(scenarioid==-1)   lr.output_message("No Scenario ID is available");else   lr.output_message("Scenario ID = " + scenarioid);

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: