Window Operations * SCW.

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Window Operations > SCW. - Search-Child-Window >

Window Operations * SCW.

"X" - Flag "run without error"

Previous Top Next


MiniRobotLanguage (MRL)

 

"X" - Flag "run without error"

Search Child Window

 

 

Intention

 

If the child-window you are looking for is not found within the specified waiting time, several things can happen. Normally you will just get an error-message. If you do not want to get an error, but just have the script continue running, use the "X"-Flag.

 

You can use the #tio# 3.1 Systemvariables to check if the window was found or not. Also you can use the "V","W","g" and "o" Flags to react inside the STW.

 

For example in such a script:

 

STW.c|WindowClass

' This button does not exist

SCW.Xcw|ButtonX|0

' We'll just move the mouse inside the Top-Window

MMV.

 

ENR.

 

This script will invert the normal behavior of STW. It will continue running in case of the window is not found. And in case the window is found, it will jump to the Label "found".

 

 

 

Short Examples:

 

'------------------------------------------------------

' "X"-Flag Sample 1

' Run only if its not yet running ...

'------------------------------------------------------

'

' Run application only if the window is not found

'

' t - text (caption of the window)

' g - gotoLabel "Sub" if thewindow was found

' X - continue the script as normal, without error,

'     if the window is not found

STW.tgXw|BCS|GoOn|0

EXE.?exepfad\Sample Apps\BSC-Testform.exe

:GoOn

MBX.Ready

ENR.

 

 

 

Example

 

'------------------------------------------------------

' "X"-Flag Sample 2

'------------------------------------------------------

'#EXE:?pfad\

'#SPI:ForceWrite

'

' Start an Application only, if that Application is not yet running.

'

' We use STW here to test if the Application is already running

' in that case we jump over the EXE-command and contine.

' We use the following flags:

' w ... 0 - Set waiting time to 0 seconds

' t ... "BCS - Testform" - this is the caption text of the window we search for

' g ... "found" - jump to Label ":found" if the window already exists

' X ... continue without errormessage if the window was not found in time

'

STW.wtgX|0|BCS - Testform|found

EXE.?exepfad\Sample Apps\BSC-Testform.exe

:found

 

' Now we can use the Application and press Buttons

STW.wt|0|BCS - Testform

SCW.nctb|1|Button|Next|0

' Compatible Button Click

MLC.

 

'-----------------------------------------------------------

ENR.

 

 

 

 

Remarks

 

You can use the #tio# 3.1 Systemvariables to check if the window was found or not. Also you can use the "V","W","g" and "o" Flags to react inside the SCW.

 

 

 

Limitations:

 

 

 

 

See also:

 

    1. STW. - Decription

    SCW - Search-Child-Window

    3.1 Systemvariables