Difference between revisions of "Target"

From OpenEUO
Jump to: navigation, search
m
m (See Also)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
''target implemented, but undocumented''
 
 
 
 
== Calling Convention ==
 
== Calling Convention ==
 
Call
 
Call
Line 16: Line 13:
 
  print(tostring(targ)..' '..tostring(time))
 
  print(tostring(targ)..' '..tostring(time))
  
  --> 'true 780'
+
  --> true 780
  
 
== Description ==
 
== Description ==
Line 29: Line 26:
  
 
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]
 
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]
 +
 +
* [[chosen]]
  
 
* [[spin]]
 
* [[spin]]
  
 
* [[type]]
 
* [[type]]
 +
 +
* [[UO.TargCurs]]

Latest revision as of 17:43, 8 January 2011

Calling Convention

Call

local targ, time = sl.target([timeout])

Args

timeout (optional) is the number of milliseconds to wait before timing out

Results

targ is a boolean and reflects the current status of UO.TargCurs
time is the number of milliseconds that have elapsed during the call

Usage Example

local targ, time = sl.target(1500)
print(tostring(targ)..' '..tostring(time))
--> true 780

Description

Target acts like easyuo's target statement; waiting for UO.TargCurs to toggle to true or timing out. Override timeout values are specified in milliseconds. The default timeout is 3 seconds. Target returns the current value of UO.TargCurs and the time elapsed (in ms) during the call.

Upon Error

A timeout argument which cannot be converted to a number is silently converted into the default timeout duration. Only a logical run time error in the library itself would cause an error; this error would be recorded and handled according to the operant error redirection mode.

See Also