<< Click to Display Table of Contents >> Navigation: 3. Script Language > Background Operation > DRS. - Drop Result |
MiniRobotLanguage (MRL)
DRS. - Drop Result
Drop Result from Background Operation
Intention
Using "Background Operations" means, that your Script execution can continue while the Robot is doing something in the background.
Some hardwired Background Operations store their Operation Results automatically when they are ready. If you do not need the Result, you should free that memory.
This is, what the DRS. command is good for.
Any result behind an "ticket-number" is stored as long, until you drop it using DRS.
You can apply the DRS. command immediately when you know the "Ticket Number" of the result.
You do not need to wait until the Operation is finished, to drop a result. If you do not need the result of an Operation, you can drop it immediately after you started the background-task. In this case, the robot will internally note that the result is been dropped and drop it immediately when it becomes available.
There is an exception:
Of course you only need to drop the Result of an Parallel-Robot (started with PRR. / PRE.) , if you use the PRS,-command to return a Result. If no Result is returned, it does not need to be dropped.
Use these commands together with Background Operations:
• GRS. - Get Result of Operation
• WRS. - Wait until (one or more) Operation(s) is/are finished
• DRS. - Drop Result of Operation if you do not need it.
• IRS. / NRS. Check if an Result is available
• JRS. / JNS. - Jump if an Result is/not available
to handle the result of the background mail-operation(s).
Example:
' Assume that a file "?path\MailConfig.dat"
' is available
SMP.
' It makes mostly sense with attachements
' SMP.attachment=?path\Send-Mail.zip
' Send the Mail, get the ticket number
SMB.
' If we do not specify a ticket number,
' DRS. will automatically remember the last ticket number
' and use it.
DRS.
WRS.
ENR.
Syntax
DRS.[P1]
Parameter Explanation
P1 - (optional) Variable that contains the "Ticket-Number" which leads to the Return code of the background job. If omitted, the last Background Operation will be taken.
Example
'***********************************
' SMB.-Sample
'***********************************
' Send away 25 Mails
' then wait until they are sent
' and then show the results of all 25 Mails.
'
'#EXE:?pfad\
'#SPI:ForceWrite
'
' Background Mailer-Demo
' Please provide a complete MailConfig.dat
SMP.?path\MailConfig.dat
' Try with attachement also!
' SMP.attachment=?path\Send-Mail.zip
$$HND=
' Be careful or you may end up with in
' an error 421 - too many connections
' from your provider
FOR.$$CNT|1|25
GSB.Lab
NEX.
DBP.$$HND
WRS.$$HND
' Display Results
FEM.Lab_dis|$$TXT|$$HND|,
MBX.!
ENR.
'-----------------------------------------------------------
:Lab_dis
GRS.$$TXT|$$RES
' Always drop Results you do not need anymore
DRS.$$TXT
DBP. Result from $$TXT = $$RES
RET.
'-----------------------------------------------------------
:Lab
SMB.
$$HND=$$HND,$$000
RET.
'-----------------------------------------------------------
Remarks
If you use Background Operations, always drop the result of the operation using DRS..
Otherwise it will be kept in Memory until the Script ends. This only applies to background operations that do post an result to the main script.
Limitations:
-
See also:
• ! Smart Package Robot 's Parallel Robot Operations
• IRS. / NRS. - If Result available
• PRE. - Parallelrobot-Run-End
• ! Smart Package Robot 's Send-Mail