lr_get_attrib_long

Returns a long integer type value of an argument passed to the script run.

long lr_get_attrib_long( char *argument_name );
Alphabetical Listing - C Language Utility Functions

Arguments

NameComments
argument_nameThe name of an argument that can be interpreted as a long integer value.

The lr_get_attrib_long function returns the value of an argument of type long integer that was passed to the run of the script.

To view the arguments passed to a script run, see mdrv_cmd.txt in the script folder.

Return Values

If this function succeeds, it returns the value of the argument. If the argument does not exist or if its value is not consistent with the type, the function returns -1.

Parameterization

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

Example

In the following example, lr_get_attrib_long retrieves the value of the loop parameter from the mdrv command line string that was used to run the script:

test1   -host sun2   -loop 4   -time 10

where test1 is the name of the executable, and host, loop and time are command line options. lr_get_attrib_long assigns the value to a variable, iterations. This variable is incorporated into the script and sets how many loops to perform.

Action() {
    long loop;
    int i;
    iterations=lr_get_attrib_long("loop");
    if (iterations==0){
        lr_error_message("Illegal value \n");
        return;
    }
    for (i=0; i <iterations; ++i) {
         /* perform test operations... */
    }
}