3.1 Systemvariables

<< Click to Display Table of Contents >>

Navigation:  2. Components > 3. System-Variable and Specialfolders >

3.1 Systemvariables

Systemvariables

Previous Top Next


MiniRobotLanguage (MRL)

 

Systemvariables

 

 

 

Intention

 

Systemvariables are replaced with the appropriate Content at runtime. They need to be written in lowercase.

 

 

Parameter Explanation

 

SYSVAR          Usage                           ASCII

$crlf$  -       CR+LF                   -       (13,10)

$cr$    -       Carriage Return         -       (13)

$lf$    -       Line Feed               -       (10)

$sp$    -       Space                   -       (32)

$tab$   -       Horizontal Tab          -       (9)

$nul$   -       Null                    -       (0)

$sq$    -       Singel Quote            -       (39)

$dq$    -       Double Quote            -       (34)

$esc$   -       Escape                  -       (27)

$eof$   -       End-of-File             -       (26)

$ff$    -       Form Feed               -       (255)

$vt$    -       Vertical Tab            -       (11)

$bs$    -       Back Space              -       (8)

$bel$   -       Bell                    -       (7)

 

 

Robot Command-Line

 

$cmdl$  -       custom commandline (in EXE-Mode use $cmdexe$)

 

 

(Text-)Clipboard Content

 

$cpb$   -       Clipboard-Content (Text)

 

 

Current running Script

 

#linenum# -     aktuelle Zeilennumber im Script

$script$  -     actual Filename, currently running script.

               Without Path.

#errnum#  - Code Number for Type of Error:

           0 - Unspecified Error. Details see Error-Message.

           1 - Syntax-Error,
           2 - Parameter-Nzmber,
           4 - Size-Error (to much or to few of something)

 
#errlin#   -    Linenumber where the last error has occurred.
$errtxt$   -    Error-Message, identical to what is shown in the Messagebox.

               This one is available in Silent-Mode, where no Messagebox appears.              

 

Variables for use with the Stack's

 

$tos$   -       insert Top-of-stack

$dtos$  -       insert Top-of-stack (nodelete)

#tos#   -       Number of items on current stack

#stack# -       returns  1 if  GLOBAL Stack is selected

                        2 -if  LOCAL Stack is selected

 

Variables for time-measurement

 

$now$   -       (Local time) Exact Time,

               Format: 2006:01:30:16:29:17:0250

$utime$ -       (UTC/Universal Coordinated Time),

               Format: 2006:01:30:16:29:17:0250

$date$  -       Actual Date, Example:    01-01-2006

$time$  -       Actual Time, Example:    12:01:40

#date#  -       Date, Format: 01302006 for 30/01/2006

#time#  -       Time, Format: 173226 for 17:32:26

#timer# -       Timer, Format: 63220.625

#datetime#      Date and Time, Format: 01302006_172430

#dtime# -       Time, Format: 3348146124.41

#dsince#-       Time, since last call to #dtime# or #dsince#

#since# -       Time since last call to #since# or #time#

 

 

Process- and ThreadID and Window Handles

 

#pid#   -       Process-ID of the last program or window. Not all execute-commands provide this.
               See help for EXS and other EXE-commands. Also set by STW. and some other such Window-Commands.

 
#tid#   -       Thread-ID of the last program or window. Not all execute-commands provide this.
               See help for EXS and other EXE-commands. Also set by STW. and some other such Window-Commands.
               Prefer using the PID, as the TID is often not set.
   

#cbw#   -       Handle of own Window

#cwh#   -       Debug Console Window-Handle

#hwn#   -       Handle, actual located window

 

 

InterKOM

 

Note: the term "CUN" (Communication Unique Number) is the same as

     the "InterKOM-Handle".

 

#cun#   -     CUN of the actual Robot, own InterKOK-Handle.

#ecun#  -     CUN of the actual Editor, if any

#fcun#  -     CUN of the Father-Process ("Father")  

#bcun#  -     CUN of the last started Mini-Browser,

             it must have been started using the LBR. Command.  

#pcun#  -     CUN of the last started Parallel-Robot,

             using the PRR. Command.

 

 

Mini-Browser only

 

Note: these Systemvariables are only resolved if an

Mini-Browser (MB) has been started from this robot, using

the LBR.-command.

If you have multiple TAB's open in the same MB,

some of these System-Variables react only on the actual selected TAB, while others are been set by any TAB that is loading at the same time.

You can use Parallel-Robots and multiple Instances of the MB to work with several Sites at the same time to overcome possible confusion when dealing with multiple sites at the same time.

 

#mb_prog#     -  0-100%, Loading Progress (Site-dependend)

 

#mb_state#    - 1/0 if actual selected TAB Browser Control

               is busy. 0 - ready, 1 - busy loading

               Result 99 if no state is available.

#mb_busy#     - 1/0 if MB overall is actually busy working

               1 - busy, 0 - ready, waiting for command

 

Generally the Browser-States occur one after the other when you load a WEB-Site. It may look like this for example:

 

[13:00:33] [12]  TAB: 0*269*SetSecureLockIcon*0*

[13:00:33] [12]  TAB: 0*102*StatusTextChange*Fertig*

[13:00:33] [12]  TAB: 0*108*ProgressChange*-1,10000*

[13:00:34] [12]  TAB: 0*104*DownloadComplete**

 

Using these System-Variables, you can either get them "One after the other" or you can only get the state that is "actual", at the time when you use the System-Variable.

Therefore you have two complete sets of system Variables.

One set wit "s" like "Serial" to get all states in order.

One set with "a" like "actual", to get only the state that is NOW.

 

 

Note: the following SysVars contain all Browser Messages in serial order. To have them switch to the next message, use the #mb_nex# at any place.

 

#mb_time# - Time of last call to LBR., CBR.goto etc..

           This is the time when you commanded to load a

           site in the MB.

 

#mb_since# - DTime since last call to LBR., CBR.goto.

           Use to measure how long a site takes to load.

 

$mb_sli$ - all Informations about the serial Event, in one

          System-Variable, separated by "*". Example:

          TAB: 0*108*ProgressChange*-1,10000*

          (Tab-Number)*(Event-Code)*(Event Name)*Additional Info)

 

#mb_stnr# - Number of the selected TAB for the serial message

           number starting from 0.

 

#mb_sevn# - Numeric Event Number for the serial Browser Event.

 

$mb_sai$ - Additional Information for the serial Browser Event.

$mb_stxt$ - State-Text Information for the serial Browser Event.

 

#mb_nex# - Use this to switch all "Serial MB-System-Variables" to the next serial Event. It will not evaluate to any value.

 

Note: the following SysVars contain all Browser Messages in actual order. This is the state of the Browser right when you use the SysVar. Using these Variables, states can be lost, if they are not more actual. You do not need to use #mb_nex# with these, because you get the actual state.

 

#mb_atnr# - Number of the selected TAB for the actual message

           number starting from 0.

 

#mb_aevn# - Numeric Event Number for the actual Browser Event.

$mb_aai$  - Additional Information for the actual Browser Event.

$mb_atxt$ - State-Text Information for the actual Browser Event.

 

$mb_ali$ - all Informations about the actual Event, in one

          System-Variable, separated by "*". Example:

          TAB: 0*108*ProgressChange*-1,10000*

          (Tab-Number)*(Event-Code)*(Event Name)*Additional Info)

 

Note: All Errors will stay in these System-Variables until they are confirmed using the #mb_cerr# System-Variable. If there occur multiple errors, only the last error is stored. The last error

overwrites a previous error, whether it was confirmed with #mb_cerr# or not.

 

#mb_err# - 0 or last MB-Error number from Mini-Browser.

          Could be for example: 2148270085

$mb_err$ - A short text that identifies the Error.

          For example: "INET_E_RESOURCE_NOT_FOUND"

$mb_ert$ - A textual description of the error.

          For example: "The server or proxy was not found."

 

#mb_cerr# - Will confirm the last Error and Reset the mb_er* Systemvariables.

 

       A list with possible Errors can be found here:

      Internet Explorer Errors and here: HTTP-Status Codes

 

 

Mouse-Position

 

#mpx#   -       actual Mouse position X

#mpy#   -       actual Mouse position Y

#opx#   -       actual Mouse position X - Client-Coords.

#opy#   -       actual Mouse position Y - Client-Coords.

#ixp#,#iyp# -   Actual Point x,y (screen Coords)

 

#il#    -       actual Element, left side X (Sreenccords)

#it#    -       actual Element, upper side Y (Sreenccords)

#ir#    -       actual Element, right side X (Sreenccords)

#ib#    -       actual Element, bottom side y (Sreenccords)

#iw#    -       actual Element, width X

#ih#    -       actual Element, height Y

#icx#   -       actual Element, Centerpoint X

#icx#   -       actual Element, Centerpoint Y

 

 

 

Timeout-Flag

 

#tio#   -       Timeout-Flag

#til#   -       Timeout-Line-Number

 

 

Screen-/ Desktop Sizes

 

#ssx#,#ssy# -   Screen size X,Y

#wsx#,#wsy# -   Work-area-Size X,Y

#sbp#   -       Screen-bits per pixel (Colordepth)

 

 

 

FEX-Enumeration

 

#fex#   -       FEX - Elements left on the FEX-Stack

#fxd#   -       FEX - Nesting-Depth

 

 

There are some more for compiled EXE's

 

$exename$     - Name of the compiled EXE (Filename)

$starttime$   - time when EXE was started

$startdate$   - date when exe was started

$cmdexe$      - commandline given to the compiled EXE

$startscript$ - Name of script-file to start first

#exemode#     - if Script runs inside an EXE (1) or not (0)

#mutex1#      - was Script started from the same EXE before?

#mutex2#      - was a script of this name started from anywhere before?

 

Hint: Timing functions like #time# and others internally use the

    windows timer. This timer will be set to zero normally around

    midnight. If your measurement will fall just into the moment

    of the timer reset, the results may be wrong.

 

 

 

Example

 

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

' Example 1

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

' Print items on Stack

PRT.Items on Stack: #tos#

 

' Time Measurement

VAR.$$TIA=#dtime#

CAS.1

VAR.$$TIB=#dsince#

PRT. Time elapsed: $$TIB

 

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

' Example 2

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

EXH..html|§§HWN|http://www.fa2.de

STW.h|§§HWN

SWP.0,0|400,400

SAO.nvw|google|google|30

MPO.

PRT. We start at: #dtime#

PRT. Process-ID of our actual window is: #pid#.

PRT. The Window-handle is #hwn#.

PRT. The actual Mouse-Position (Screen) is: #mpx#,#mpy#

PRT. The actual Mouse-Position (Window) is: #opx#,#opy#

PRT. The actual Screensize is: #ssx#,#ssy#

PRT. The actual Workarea-Size is: #wsx#,#wsy#

PRT. The actual point is also at: #ixp#,#iyp#

PRT. Our Screen-colourdepth is: #sbp#

PRT. These Printouts took: #dsince# ms.

DMP.

END.

 

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

' Example 3

' Mini-Browser

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

LBR.svf=0|Pos=Mid|site=www.fa2.de

DOL.1

 DBP. Progress: #mb_prog#

 DBP.State: #mb_busy# - #mb_state#

OOP.(#mb_busy#=0)

MBX.Ready

ENR.

 

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

' Example 4

' Mini-Browser

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

LBR.svf=0|Pos=Mid|site=www.fa2.de|site=www.fa33.de

FOR.$$CNT|1|300

 DBP. $mb_sli$ #mb_nex#

NEX.

MBX.Ready

ENR.

 

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

' Example 5

' Mini-Browser - Site loading.

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

'

LBR.Size=1024,980|Pos=0,0|svf=0|site=www.fa2.de

WBR.

DBP. Site loaded in #mb_since# seconds (Start-Time: #mb_time#).

ENR.

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

3.1 Systemvariables

3.2 Standard-Search Pattern

3.3 Specialfolders

3.4 System-Colors

3.5 Hexadezimal, Decimal and Binary and more

3.6 Using Quadrant-Coordinates