Share this page

# lr_paramarr_random

Returns the value of the parameter at a random location in a parameter array

    char *lr_paramarr_random( const char * paramArrayName);

Alphabetical Listing - C Language Utility Functions

## Arguments

Name | Comments
--- | ---
paramArrayName | The name of the parameter array.

lr_paramarr_random returns a string containing the value of the parameter in a parameter array. The value is returned from the parameter at a position chosen randomly.

## Return Values

A pointer to a string buffer containing the value. If the parameter array is empty or does not exist, returns NULL.

## Parameterization

Standard parameterization is not available for this function.

See Also

## Example

This example shows how to get a random value from a parameter array.

    char * FlightVal;
    web_reg_save_param("outFlightVal",
        "LB=outboundFlight value=", "RB=>",
        "ORD=ALL",
        "SaveLen=18",
        LAST );
    web_submit_form("reservations.pl",
        "Snapshot=t4.inf",
        ITEMDATA,
        "Name=depart", "Value=London", ENDITEM,
        "Name=departDate", "Value=11/20/2003", ENDITEM,
        "Name=arrive", "Value=New York", ENDITEM,
        "Name=returnDate", "Value=11/21/2003", ENDITEM,
        "Name=numPassengers", "Value=1", ENDITEM,
        "Name=roundtrip", "Value=<OFF>", ENDITEM,
        "Name=seatPref", "Value=None", ENDITEM,
        "Name=seatType", "Value=Coach", ENDITEM,
        "Name=findFlights.x", "Value=83", ENDITEM,
        "Name=findFlights.y", "Value=16", ENDITEM,
        LAST );

    Example: The result of the web_reg_save_param having been called before the web_submit_form is:
    Notify: Saving Parameter "outFlightVal_1 = 230;378;11/20/2003"
    Notify: Saving Parameter "outFlightVal_2 = 231;337;11/20/2003"
    Notify: Saving Parameter "outFlightVal_3 = 232;357;11/20/2003"
    Notify: Saving Parameter "outFlightVal_4 = 233;309;11/20/2003"
    Notify: Saving Parameter "outFlightVal_count = 4"

    FlightVal = lr_paramarr_random("outFlightVal");

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: