lr.get_attrib_double
Returns a double type value of a parameter passed to the script run.
JavaScript
function lr.get_attrib_double( parameter )
VBScript
Function lr.get_attrib_double( parameter )
| Command Line Parsing Functions |
Arguments
| Name | Comments |
|---|---|
| parameter | The name of a parameter 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. You place the command line parameter's name in the function's argument field and lr.get_attrib_double returns the value of that parameter.
Return Values
On success, returns the value of the parameter. If the parameter does not exist or if its value is not consistent with the type (for example a flag parameter), returns -1.
Parameterization
Standard parameterization is not available for this function.
VBScript Example
In the following example, lr.get_attrib_double, lr.get_attrib_long, and lr.get_attrib_string retrieve the values of the command line arguments from this command:
Public Function Init() As Long
Dim wait_time as Double
Dim secInYear as Long
Dim mrsCollins as String
Dim i, loops as Integer
loops = 3
wait_time = lr.get_attrib_double("time")
secInYear = lr.get_attrib_long("secondsInYear")
mrsCollins = lr.get_attrib_string("MrsCollins")
' If the commands succeeded, output the values
if (wait_time <= 0 )then
lr.message "Illegal time value = " + Cstr(wait_time)
Init = lr.PASS
Exit Function
else
lr.message "Wait time value =" + Cstr(wait_time)
lr.message "The number of seconds in a year is" + Cstr(secInYear)
lr.message "Mr.Collins' wife is named" + mrsCollins + "Lucas"
end if
' Use the time from the command line
for i = 0 To(loops - 1)
' Your business process or test goes here
lr.message "Time and date:" + Cstr(Time)
lr.think_time(wait_time)
next i
lr.message "Time and date:" + Cstr(Time) ' FormatDateTime(Time)
Init = lr.PASS
End Function

