<< Click to Display Table of Contents >> Navigation: 3. Script Language > ! User-Macros > ! Smart Package Robot 's Script language |
MiniRobotLanguage (MRL)
Defining your own Commands: MACROS
Smart Package Robot 's Script language can be extended using own Macros.
Besides using the Commands, that are already defined for you, you can define own, new commands.
In this chapter you can find Samples for such "User-Defined Commands". They are called "Macros".
There are multiple Samples in the "User-Library" Folder.
To make Using Macros more easy, use
2.1.A #LIB: - User-Library Path
and
1.1 #INC: - Pre-Processor File-Include
In this Chapter you will find examples of useful User-Macros that you can use to enhance your Scripts.
' Macro-Example:
' These Macros will implement a Time-FOR-Loop using Macros
' Please note the use of 'EIF- and 'EIF+ in the Macro for the Editor Formatting.
' This Loop will Loop from 08:09:59.000 to 08:10:01.000
$$TIA=08:09:59.000
$$TIB=08:10:01.000
'$$LOP=$$TIA
$$INC=00:00:00.010
%FOT $$TIA|$$TIB|$$INC
PRT.Looping: $$LOP
%NXT
MBX.$$LOP
ENR.
'----------------------------------
' The two Macros that implement a Time-Loop
'----------------------------------
: %FOT 3
$$FOA=§§§01
$$FOB=§§§02
$$FOC=§§§03
$$LOP=$$FOA
DOL.
'EIF-
END%
'----------------------------------
: %NXT
TCA.Add|$$LOP|$$INC|$$LOP
IVS.$$LOP=$$TIB
$$LOV=1
ELS.
$$LOV=0
EIF.
OOP.$$LOV
'EIF+
END%
'----------------------------------