Job Management Partner 1/Software Distribution Administrator's Guide Volume 1
There are the following three types of operators. With these operators, you can concatenate character strings, perform numerical calculations, or use an If statement to perform comparison operations.
When using any of these operators, place a space both before and after it.
Operator | Function | Remarks |
---|---|---|
& | Concatenates character strings. | 0 to 128 characters |
The ampersand (&) character string operator can concatenate character strings. The character strings to be concatenated and the variables for containing the combined character string must be a character string type (String). Each of the character strings can have up to 128 characters. The character string made by concatenation also has up to 128 characters. If the number of characters in the character string exceeds 128 during concatenation, the excess is truncated (the processing is continued).
You can assign a zero-length character string to a variable, using double quotation marks ("").
Dim S As String Dim Ch1 As String Dim Ch2 As String Ch1 = "" ' (Initialize Ch1 with a zero-length string) Ch1 = "JP1/SD " Ch2 = "for WindowsNT" S = Ch1 & Ch2 MsgBox(S, 30) ' "Software Distribution for WindowsNT" is displayed ' in the message box.
Operator | Function | Remarks |
---|---|---|
+ | Performs the addition of integers. | -32,768 to 32,767 |
- | Performs the subtraction of integers. | None. |
* | Performs the multiplication of integers. | None. |
/ | Performs the division of integers. | Digits below the decimal point are truncated. |
You perform addition, subtraction, multiplication, and division of numeric values using numeric value operators. Multiplication and division are performed before addition and subtraction. It is not possible to change the calculation sequence by using left and right parentheses ( and ).
The numeric values to be calculated and the variables for storing the calculation results must be integer type (Integer). The numeric values from -32,768 to 32,767 can be used for calculation. The calculation result must also be -32,768 to 32,767. If a calculation produces a value outside the -32,768 to 32,767 range, the subsequent statements are not executed and the script is terminated. When there is an On InstallError statement for handling this error, the postprocessing specified in the statement is executed.
Dim I As Integer Dim J As Integer Dim K As Integer I = 6 J = 2 K = I * J + I / J - 1 ' K is assigned 14
Operator | Function | Remarks |
---|---|---|
= | 1. Substitutes a variable | c = a + b |
2. Checks for equality | Used in an If statement (IF a = b Then...) | |
< | Less than | Used in an If statement |
> | Greater than | |
<= | Less than or equal to | |
>= | Greater than or equal to | |
<> | Not equal to |
When comparison operators are used in If statements as shown below, a comparison can be performed. Data of the character string type, numeric type, or system type can be used as the left and right sides to be compared in an expression.
The data types of the left and right sides must be the same. More than one comparison operator cannot be used in one expression.
Dim S As String Dim I As Integer S = "JP1/SD" If S = "JP1/SD" ' This becomes true Then : End If If S = "SD" ' This becomes false Then : End If If S = "JP1/SD Client" ' This becomes false Then : End If I = 10 If I > 9 ' This becomes true Then : End If
All Rights Reserved. Copyright (C) 2009, 2013, Hitachi, Ltd.
Copyright, patent, trademark, and other intellectual property rights related to the "TMEng.dll" file are owned exclusively by Trend Micro Incorporated.