Keyboard Typing Simulation

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Keyboard Typing Simulation >

Keyboard Typing Simulation

RST. - Replace Selected Text

Previous Top Next


MiniRobotLanguage (MRL)

 

RST. Command

Replace Selected Text

 

Direct Engine_01

 

Intention

 

The RST.-Command can be used to set a textbox to a specified text. It will change the Text of the actual localized Top-/or Child-window to the text that you specify.

 

Here is an example for a textbox.

 

graphic

 

RST. uses the Direct engine and therefore   does not interpret any special Keyboard sequences like SKP. Using RST. the text is been send directly to the window and will replace the part of the text that is specified with the numeric parameters.

 

The command will select the Text given with the Parameters P2,P3 and then replace this Text (-Part) with P1. The unselected Text remains as before.

 

To signal that all Text until the last Character should be replaced, the P2 has to be "-1" which means " until End of Text".

 

Here is an example. This is a textbox in our Test-Application.

 

graphic

 

Now we start this small script:

 

STW.ct|PBWindowClass:0|TestApp

SCW.nc|2|Edit

RST.--|1,3

 

And this is the textbox after the script:

 

graphic

 

As you can see the numeric argument is zero-based. You can use variables and formulas in (..) for the numeric arguments:

 

RST.--|1,(2+1)

 

You can read more about Keyboard-Simulation and Text-Boxes in the chapter:

1.9.1.6 Edit-Textbox Control

 

 

 

Syntax

 

RST.P1[|P2,P3]

 

 

Parameter Explanation

 

P1 - Text that is sent to the textbox

 

P2 - (optional) zero based character number, start of selection.

    If omitted 0 is the default.

 

P3 - (optional) character number, end of selection.

              If omitted, last character (-1) is the default.

 

 

 

 

Example

 

' Replace the whole Text with the new Text

RST.$$TXT|0,-1

 

' Replace the whole Text with the new Text

RST.$$TXT

 

' Clear Text

RST.

 

' Replace Letters 2 to 5 with the new Text

RST.$$TXT|2,5

 

' Replace Letters 1 to 3 with ---

RST.---|1,(2+1)

 

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

' RST. - Sample

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

'

EXE.?exepath\Sample Apps\TestApp_01.exe

 

STW.ct|PBWindowClass:0|TestApp

SCW.nc|2|Edit

RST.We can write into a  Text-box

 

ENR.

 

 

 

Remarks

 

Direct Engine command.

 

 

 

Limitations:

 

RST. will only work on windows. It will normally not work with WEB-based or Office-Controls.

 

 

 

See also:

 

    1.9.1.6 Edit-Textbox Control

    SDT. - SenD-window-Text

    SKP. Send-Key-Press

    SKT. - Send-Key-Text

    WNK. - Wait-No-Key