Debugging Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Debugging - Commands >

Debugging Commands

PAU. - Pause

Previous Top Next


MiniRobotLanguage (MRL)

 

PAU. Command

Pause

 

 

Intention

 

Pauses Script execution for a given amount of time. Give CPU-time back to the windows system. Possible use cases are:

    At some places the script may execute too fast, then you may want to slow it down.

    if you make a so called "endless loop", it makes sense to give some computing power back to the system.

In both cases you can use the PAU. Instruction. Usage is as easy as possible. Just write:

 

' pause for 1 second

PAU.1

 

When the script comes to that place it will just wait for 1 second. Behind the curtains, it will leave the  CPU to other processes for the given amount of time.

 

1 second  can be a lot of time, but its up to you, how long you want the script to PAU.

You can make it wait for 5 hr like this:

 

PAU.5|hr

 

or even let it wait for a Year (in seconds):

 

'  This is 6 hrs in milliseconds

PAU.21600000|ms

' this is also 6 hrs., in minutes

PAU.360|min

' and this is 6 hrs. in secons

PAU.21600|s

 

but normally you would write it like this:

 

PAU. 6|hr

 

You can use smaller times, starting up with 1 ms.

 

' This will wait for a tenth of a second

PAU.0.01

' this is the same

PAU.100|ms

 

You can choose values down to 1 ms, there are no half or zero milliseconds.

 

 

 

Syntax

 

PAU.[P1][|P2]

 

 

Parameter Explanation

 

P1 - Time to pause

 

P2 - (optional) Time unit (default is seconds)

     Possible values are:

 

    hr  = hour

    min = minute

    sec = seconds (default when P2 is missing)

    ms  = milliseconds

 

 

Example

 

'*****************************************

' Sample: PAU

' AWT at 2011-07-30

'*****************************************

 

' pause in length of 1 second

PAU.1

 

' pause in lenght of half second

PAU. 0.5

 

'pause in length of 1 hour

PAU. 1|hr

 

'pause in length of 2 minutes

PAU. 2|MIN

 

' Example using a variable

$$PAU=0.25

PAU.$$PAU

 

 

 

Remarks

 

PAU. will only PAUSE the script at one place. If you want the whole script to be slowed down, use DIP. - Delayed Instruction Processing. The robot is able to receive messages while in PAU. Mode.

 

 

Limitations:

 

The internal time calculations are done with 32 bits of Precision in ms. You can choose values down to 1 ms, there are no half or zero milliseconds. There is no upper limit you should be able to run against.

 

 

 

See also:

 

  DIP. - Delayed Instruction Processing

  1.B Error handling