Script Functions: It copies characters of a string.
STR_CUT(String, Start, [Length])
MID(String, Start, [Length])
SUBSTR(String, Start, [Length])
Syntax |
Description/Format |
---|---|
String |
An alphanumeric string. |
Start |
The start position for the part that should be copied. |
Length |
The number of characters that should be copied. |
Return code |
---|
A part of a string. |
These scriptA particular Automation Engine object type. functions all serve the same purpose. They copy characters from a given String. Length is an optional parameter - not specifying it means that all characters until the end of the String are returned.
The string itself remains unchanged.
In the first example, the script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… returns "CD". The result of the second example is "CDEFGH" - all characters until the end of the string are included.
:SET &STRING# = MID("ABCDEFGH",3,2)
:SET &STRING# = SUBSTR("ABCDEFGH",3)
The following example uses the script function SUBSTR to split a userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management.-defined term. The first three characters are assigned to the first script variable and the last character to the second script variable.
:READ &TABNAME#, "04", "Please specify table
name xxxy"
:SET &TABPRE# = SUBSTR(&TABNAME#,1,3)
:SET &TABSUF# = SUBSTR(&TABNAME#,4,1)
See also:
Script element | Description |
---|---|
It replaces characters or strings within a string. | |
STR_CAT | It combines two strings to a new string. |
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |