lr.get_attrib_double
Returns a double type value of an argument passed to the script run.
double lr.get_attrib_double( 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 double value. |
The lr.get_attrib_double function returns the value of an argument of type double precision floating point 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 parameter does not exist or if its value is not consistent with the type (for example a flag parameter), the function returns -1.
Parameterization
You cannot use standard parameterization for any arguments in this function.
Example
In the following example, lr.get_attrib_double retrieves the value of the time 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_double assigns the value to a variable, wait_time. This variable is incorporated into the script and sets how long to wait between loops.
double wait_time;
int i;
wait_time=lr.get_attrib_double("time"); if (wait_time==0){
lr.message("Illegal time value \n");
return;
}

