演算子(Impact)

Impact5.1のIPLで使用できる演算子について以下に示す。
■Assignment operator
 例:
 a = 3;
 b = “This is a test”;
 c = {“One”, 2, True};
 MyContext.a = “Test”;
 MyArray[0] = “Another test”;
 @Summary = “Node ” + @Node + ” not responding”;
■Mathematic operators
 + 足す
 - 引く
 * かける
 / 割る
 % 係数
 例:
 a = 1 + 2;
 b = 4 – 3;
 c = 6 * 4;
 d = 6 / 4;
 e = 8 % 5;
■Comparison operators
 < Less than  > Greater than
 == Equal to
 <= Less than or equal to  >= Greater than or equal to
 != Not equal to
 LIKE Performs a comparison using Perl 5 regular expressions
 例:
 If ((a >= 4) || (b <= 3)) ...  If ((a == "Test") && (b != "Test")) ...  If (a LIKE "New York.*") ... ■Boolean operators  || OR  && AND  ! NOT  例:  If ((a == 4) || (b <= 3)) ...  If ((a = "Test") && (b != "Test")) ...  If (!MyBool) ... ■String operators  例:  MyArray = {};  MyString = 'test';  MyArray = MyArray + MyString;  This will add MyString as a new element to the Array.  Also in an Array you can remove an element using the Subtraction operator. If you do the  following:  MyArray = {test, test2};  MyString = 'test';  MyArray = MyArray - MyString;  log(MyArray);  ↑この結果、logにより配列MyArrayはtest2だけ表示される。 大切な人へのXmasプレゼントに「月の土地」

コメント

タイトルとURLをコピーしました