Share this page

# lr_exit

Exits from the script, action, or iteration.

    void lr_exit (int continuation_option, int exit_status);

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
continuation_option | The Script Continuation Options specifies how the script continues after the call to lr_exit
exit_status | The Script Exit Status of the scenario group as a result of calling lr_exit

The lr_exit function allows you to exit from the script run during execution.

A transaction in which lr_exit is called does not appear in Controller in the Transaction Status box. It is ignored in the count of passed and failed transactions.

If lr_exit is called several times in the same script, whether in different actions or different iterations, it is the exit status of the last call that determines the status of the Vuser group running the script. The Controller Scenario Groups Status box displays the status. It is the column in which the group appears after the run stops.

lr_exit(LR_EXIT_VUSER, LR_ABORT); is equal to lr_abort

## Return Values

No value is returned.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## Example

In the following example, lr_exit stops running the Vuser if the connection with the ftp server fails.

    vuser_init() {

         int status = ftp_logon("FTP", "URL=ftp://user:pwd@ftp.merc-int.com",
    	        "LocalAddr=ca_server:21", "ClientCert=/ca/pem/",
                   "ClientKey=/ca/pem/key/", "ClientPassword=@3#$8800cvd",
                   "CertificateAuthority=/ca/", "SSLVersion=SSL3", LAST );

         if (status == LR_FAIL) {
              lr_error_message ("ftp login failed");
              lr_exit(LR_EXIT_VUSER, LR_FAIL);
         }

         return(0);
    }

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: