Share this page

# lrvtc_get_column_range

Retrieves a range of values from a column, from a start index to an end index.

Note: This function is supported from version 26.3.

## C Language

    VTCERR2 lrvtc_get_column_range ( char *columnName, int start, int end );

## C# Language

    void vts.get_column_range ( string columnName, int start, int end );

## Java Language

    int Lrvtc.get_column_range ( string columnName, int start, int end );

## Arguments

Name | Comments
--- | ---
columnName | The column name.
start | The row number to start retrieving from. The first row has index 1.
end | The row number to stop retrieving at (inclusive).

lrvtc_get_column_range retrieves the values in the specified row range from the given column. The retrieved values are stored as `{columnName}` for a semicolon-delimited concatenation of all values, and `{columnName_count}` for the number of values retrieved.

Tip: To avoid performance issues, it is recommended to keep the range smaller than 1000.

## Return Values

Protocol | Return Value
--- | ---
C and Java languages | Returns zero on success, or one of the Error Codes on failure.
C# Language | No return value.

## Parameterization

All string input arguments can be passed using standard parameterization.

## C Language Example

Copy code

    char  *VtsServer = "localhost";
    int   nPort = 8888;
    int   rc, rc1;

    rc = lrvtc_connect(VtsServer,nPort,VTOPT_KEEP_ALIVE);
              lr_log_message("Connect result rc=%d\n", rc);

    rc1 = lrvtc_get_column_range("MyColumn1", 3, 5);
    lr_log_message("rc1=%d\n", rc1);
    lr_log_message("count=%s", lr_eval_string("{MyColumn1_count}"));
    lr_log_message("val1=%s", lr_eval_string("{MyColumn1}"));

## C# Language Example

Copy code

    vts.connect("localhost", 8888, LoadRunner.ConnectionOptions.KeepAlive);
    int rc = vts.get_column_range("MyColumn1", 3, 5);
    lr.log_message("rc = " + rc.ToString());
    lr.log_message("test = " + lr.eval_string("{MyColumn1}"));

## Java Language Example

Copy code

    import lrapi.lr;
    import lrapi.vts.Lrvtc;
    import lrapi.vts.Constants;
    public class Actions {
       private static final String VtsServer = "localhost";
       private static final int nPort = 8888;
       private static int rc = 0;
       public int init() throws Throwable {
           rc = Lrvtc.connect(VtsServer, nPort, Constants.VTOPT_KEEP_ALIVE);
           lr.log_message("rc=" + rc + "\n");
           return 0;
       }// end of init

       public int action() throws Throwable {
              int rc1 = Lrvtc.get_column_range("MyColumn1", 3, 5);
              lr.log_message("rc1=" + rc1 + "\n");
               lr.log_message("values=" + lr.eval_string("{MyColumn1}\n"));
               return 0;
       }// end of action

       public int end() throws Throwable {
           // -- API disconnect
           Lrvtc.disconnect();
           // end of API disconnect --
           return 0;
       }// end of end
    }

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