Copy |
Top Previous Next |
The following commands have been implemented in EMUEScript exactly as they are implemented in OLIE™:
Syntax - With Variables Copy <variable name> <source value> [<starting position> <length>] Where: <variable name> is the user defined name that is assigned to the variable. <source value> is a literal string or a variable that contains a literal string. <starting position> is an integer or a variable that contains an integer. <length> is an integer or a variable that contains an integer.
Description: When this command is used without <starting position> and <length>, the entirety of the <source value> is copied into the variable specified by <variable name>. Copy can be used to create new variables or to assign new values to existing variables. Copy is also used to copy the number of characters defined by <length> from the position defined by <starting position> of the source value and store the result in the variable specified by <variable name>.
Sample 1: The following statement uses the Copy command to store the literal string "AMC" into a variable named Facility. Copy Facility "AMC"
Sample 2: The following statement uses the Copy command to retrieve the two digit year from DOS, assuming that DOS is formatted in the MM/dd/yy format, and will store the result into a variable named YY. The command copies two characters starting at position seven. Copy YY DOS 7 2
Syntax - With File Copy <variable name> File <starting position> <length> Where: <variable name> is the user defined name that is assigned to the variable <starting position> is an integer or a variable that contains an integer <length> is an integer or a variable that contains an integer
Description: When this command is used with File, text is copied from the current line of the Input File rather than from another variable. In this case, the <starting position> and <length> must be specified. The number of characters defined by <length> starting at position <starting position> are copied from the input file and stored in the variable <variable name>.
Note: The copy command is used with fixed width files where each field always has the same starting position. For delimited files, the CopyField command should be used.
Sample: The following statement uses the Copy command to store specific text located at the first character for 10 characters, from the InputFile into a variable named TextFromFile. Copy TextFromFile File 1 10
In addition, EMUEScript has implemented enhancements to the features and functions of this command. The following describes the enhancements to this command implemented in EMUEScript.
Syntax - With Screen Copy <variable name> Screen <row> <column> <length> Where: <variable name> is the user defined name that is assigned to the variable <row> is an integer or a variable that contains an integer <column> is an integer or a variable that contains an integer <length> is an integer or a variable that contains an integer
Description: When this command is used with the Screen keyword, text is copied from the terminal screen. The <row> and <column> fields specify the position where EMUE will begin copying text and the <length> field determines the number of characters that are copied. The result is stored into <variable name>.
This command can be built with an option in the context menu on the terminal screen.
Sample: The following statement copies a balance off of the terminal screen and stores it into a variable called balance. Copy Balance Screen 5 15 9
In addition, EMUEScript has implemented enhancements to the features and functions of this command. The following describes the enhancements to this command implemented in EMUEScript.
Syntax - UserInput Copy <variable name> USERINPUT <PromptMessage> [<DefaultValue>] Where: <variable name> is the user defined name that is assigned to the variable. <PromptMessage> is a literal string or a variable containing a literal string. <DefaultValue> (optional) is a literal sting or a variable containing a literal string.
Description: The UserInput option on the Copy command is used to obtain input, in the form of a literal string, from a user using a dialog box. This option pauses the processing of the script and opens a dialog box. The <PromptMessage> is displayed in the dialog box and any non-empty response is stored as the <variable name>. If the response is empty, the default <DefaultValue> is stored as the <variable name>.
Note: All backslashes (\) that appear in the string literal should be replaced by two backslashes (\\) so that EMUE does not mistake the backslash for an escape character.
Note: If the <DefaultValue> is not valued and the response is empty the <variable name> is valued with an empty string.
Sample: The statement below asks the user to "Please enter the Total Balance" and defaults to a value of 1000.00. The result is placed into the variable named BalanceTotal. Copy BalanceTotal UserInput "Please enter the total to balance" "1000.00"
Syntax - EncryptedInput Copy <variable name> ENCRYPTEDINPUT <PromptMessage> [<DefaultValue>] Where: <variable name> is the user defined name that is assigned to the variable. <PromptMessage> is a literal string or a variable containing a literal string. <DefaultValue> (optional) is a literal sting or a variable containing a literal string.
Description: The EncryptedInput option on the Copy command is used to obtain sensitive input such as a password, in the form of a literal string, from a user using a dialog box. This option pauses the processing of the script and opens a dialog box. The <PromptMessage> is displayed in the dialog box and any non-empty response is masked as it is typed, encrypted and stored as the <variable name>. If the response is empty, the default <DefaultValue> is stored as the <variable name>.
Note: All backslashes (\) that appear in the string literal should be replaced by two backslashes (\\) so that EMUE does not mistake the backslash for an escape character.
Note: If the <DefaultValue> is not valued and the response is empty the <variable name> is valued with an empty string.
Sample: The statement below prompts the user to "Please enter your password" without a default value specified. The result is encrypted and placed into the variable named Password. Copy Password EncryptedInput "Please enter your password"
|