lr.get_attrib_long
Returns a long integer type value of an argument passed to the script run.
long lr.get_attrib_long( String argument_name );
| Command Line Parsing Functions | Java Syntax |
Arguments
| Name | Comments |
|---|---|
| argument_name | The 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 command line string
test1 -host sun2 -loop 4 -time 1.5
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.
long iterations;
long loop;
iterations=lr.get_attrib_long("loop");
if (iterations==0){
lr.message("Illegal value");
}

