Operator

Using operator in EPL, there are two ways, using operator or using EPL provided global function to instead, because EPL is a command-based programming language. The following lists all the operator of EPL. Notice that, lower priority number for higher priority. The higher priority operator execute before lower priority.

Operator Priority Command Name Description
() 0
- 1 Neg Returns the negative value of a numeric value
* 2 Mul Returns the product of two numeric values
/ 2 Div Returns the quotient of two numeric values
\ 3 DivE Returns the integer part of the quotient of two numeric values
% 4 Mod Returns the remainder of two numeric values
+ 5 Add 1, Returns the sum of two numbers; 2, Concatenates two String and return the result; 3,Concatenates two Bin and returns the result
- 5 Sub Returns the difference between two numeric values
<> 6 Unequal Returns True if the "Value1" is not equal to "Value2", otherwise returns False
= 6 Equal Returns True if the "Value1" is equal to "Value2", otherwise returns False
< 6 Less Returns True if "Value1" is less than "Value2", otherwise returns False
> 6 Greater Returns True if "Value1" is greater than "Value2", otherwise returns False
<= 6 LessEqual Returns True if "Value1" is less than or equal to "Value2", otherwise returns False
>= 6 GreaterEqual Returns True if "Value1" is greater than or equal to "Value2", otherwise returns False
&& 7 And Returns True if the two parameters are both True, otherwise returns False.
|| 8 Or Returns True if any one of the two parameters is True, otherwise returns False
= 9 Set Value assignment

Evaluation

Evaluate Property

Every controls or components may have their properties, the data type of the each property could be different types, such as Caption, Text are String type, and Width, Height are Integer type, Visible, Disable are Boolean type.

For String, Number, Boolean type property, you can use the same type variable, invariable, property to evaluate, such as the following lines of codes

 

          TextBox1.Text = “This is a string type invariable”

          TextBox1.Text = TextBox2.Text

          TextBox1.Text = CStr(1024)

          _MainForm.Height = 100

          _MainForm.Visible = True

 

For color relative property, it is Integer type, you can directly evaluate it by number, color constants, RGB() function, such as the following lines of codes

 

          _MainForm.BackColor = 0

          _MainForm.BackColor = #Blue

          _MainForm.BackColor = #RGB(128,128,128)

 

For picture relative property, such as “Picture”, “BackPicture”, it is Bin type, you can evaluate the picture property with bin type data, the bin type data can be picture type resource in Resource Table, such as the following lines of codes

 

          _MainForm.Picture = #Picture1

          _MainForm.Picture = FileToBin(“c:\1.jpg”)

 

For clear this type property, just evaluate the property with an empty bin, such as the following line of code

 

          _MainForm.Picture = {}

 

For DateTime type property, the invariable to evaluate must surround by “[]” mark, such as the following line of code

 

          MonthCalendar1.Today = [2005-8-29]

Evaluate Variable

You can evaluate a pre-defined variable by variable, invariable and all same type value directly, see picture of example as below

EPL

Evaluate Calculation-Result

You can also evaluate a variable or other element that can be evaluated by calculation result, such as the following lines of codes

          n = 2 * 3 + 5 / 2

          Textbox1.Text = Textbox2.Text + Textbox3.Text + str + CStr(#Pi)

 

To evaluate, you can use the operator as below

Operator Priority Command Name Description
= 9 Set Value assignment

String Combination

To combines two or mores strings together you could use “+” operator, such as: str = str1 + “ “ + str2 + “ “ + “any string”

Value Comparison

Comparison of two values of same data type can execute directly, but for two values of different data types, the EPL system will convert the two types to one type before execute comparison automatically, if fail to convert, the application will report error when running. To compare two values, you can use the operators as below

Operator Priority Command Name Description
<> 6 Unequal Returns True if the "Value1" is not equal to "Value2", otherwise returns False
= 6 Equal Returns True if the "Value1" is equal to "Value2", otherwise returns False
< 6 Less Returns True if "Value1" is less than "Value2", otherwise returns False
> 6 Greater Returns True if "Value1" is greater than "Value2", otherwise returns False
<= 6 LessEqual Returns True if "Value1" is less than or equal to "Value2", otherwise returns False
>= 6 GreaterEqual Returns True if "Value1" is greater than or equal to "Value2", otherwise returns False

Strongly recommend convert the data type before comparing value, to convert the data type you can use functions of CInt(), CStr(), CBin(), CTime(), Val() etc.

Math Expression

To make math expression, you can use the operators as below

Operator Priority Command Name Description
() 0
- 1 Neg Returns the negative value of a numeric value
* 2 Mul Returns the product of two numeric values
/ 2 Div Returns the quotient of two numeric values
\ 3 DivE Returns the integer part of the quotient of two numeric values
% 4 Mod Returns the remainder of two numeric values
+ 5 Add 1, Returns the sum of two numbers; 2, Concatenates two String and return the result; 3,Concatenates two Bin and returns the result
- 5 Sub Returns the difference between two numeric values

The following is a math-expression statement example,

 

          n = (6 * 12 + 16 / 8 - 23) / 10

 

after execute this math expression, the variable of n will change to be 5.

Multi Conditional Determinations

To determine multi conditions in one code line is True or False, you can use the operators as below

Operator Priority Command Name Description
&& 7 And Returns True if the two parameters are both True, otherwise returns False.
|| 8 Or Returns True if any one of the two parameters is True, otherwise returns False

 

See the picture as below

EPL