Automation Engine Script Guide > Introduction > Advanced Users > Return Codes of Functions

Return Codes of Functions

Script functions supply return codes, which distinguishes them from scriptA particular Automation Engine object type. statements. Return codes can be individual characters, strings or numbers. Note that numbers are always supplied in 16 digits with leading zeros.

Example:

:SET &SUMME# = ADD(2,2)
:
PRINT &SUMME#

The result that can be displayed with the PRINT functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… looks as shown below:

0000000000000004

If numbers should be output (e.g. in the reportA report provides more detailed information about a task's execution or a component.), the leading zeros can be removed with the script function FORMAT. The zeros, however, do not affect the further processing of the number (e.g. arithmetic operations).

The return codeThe value that represents the result of tasks and script functions. can also contain an error number. The descriptions of the script elements include more detailed information about possible error types and their meanings. Particular script elements are available that allow for the further handling of the error number.

Some script elements must be used in combination in order to submit valuable information. The script function PREP_PROCESS_FILE, for example, generates a data sequenceAn internal listing of Console outputs or lines of Variable objects, etc. The lines of a data sequence can be accessed by using a PROCESS loop or the script element GET_PROCESS_LINE. The script elements PREP_PROCESS* generate data sequences. from the content of a text file. The return code is a handle. The individual lines of the text file can be read with the script function GET_PROCESS_LINE which requires the handle that was retrieved with PREP_PROCESS_FILE.

 

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH