Mathematical and algorithmic operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Mathematical and algorithmic operations >

Mathematical and algorithmic operations

GRM. - Get Rectangle Middle-Point

Previous Top Next


MiniRobotLanguage (MRL)

 

GRM. Command

Get Rect Middlepoint

 

 

Intention

 

The GRM-Command will simply take any Rectangular Area, and calculate the Middle-Point of it, so you can move the Mouse there.

 

$$REC=120,200,220,300

GRM.$$REC|$$MID

DBP.$$MID

' Result is 170,250

 

GRM. understands Quadrant Coordinates, see 3.6 Using Quadrant-Coordinates .

It will take the last localized Object as base for the Quadrants. This way, you can split any type of objects or control in an resolution independent way into 16 Quadrants!

 

Here is an example for the whole window:

 

STW.ct|MyClassName|Sample Application

' We use the actual window-Rect and get the

' Quadrant D1 Middle-Point this way.

GRM.{D1}

' Show TOS

DBP.$$000

ENR.

 

 

graphic

 

 

Syntax

 

 

GRM.[P1][|P2]

 

 

Parameter Explanation

 

P1  - (optional) Input-Rectangle. Format is: x1,y1,x2,y2 if omitted,

            GRM. uses the rectangle on TOS, or if this not an Rectangle in the above format,

             it will use the actual window rectangle.

 

 GRM. understands the 3.6 Using Quadrant-Coordinates. Quadrant Coordinates.

   It will take the last localized Object as base for the Quadrants.

 

 

P2  - (optional) Variable that will receive the result of the operation in the format:

      x1,y1        

      If you omit P2, the command will store the coordinates on the TOS.

     

 

 

 

Example

 

' Use the Testapplication

' for this Sample Script

$$REC=120,200,220,300

GRM.$$REC|$$MID

DBP.$$MID

ENR.

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

 

See also:

 

    3.6 Using Quadrant-Coordinates

    1.8. Selecting the Application (Topwindow)

    1.9. Locating Child-Windows

    ! SCW - Search-Child-Window

    !. STW. - Description

    CST. - Coordinate System Transform

    GAR. - Get actual Rectangle

    MAP. - Move Active Point