What is Expression:
9+8*7+(6+5)*(4+-1*2+3)+SIN(1)*100+2^3 <=======
that is expression
ITTS support expression
when:
1: variable assignment
2: the field of "Process" exist expression
value
Expression support following
operator:
+ - * / ^
> return 1 if true return 0 if false
< return 1 if true return 0 if false
>= return 1 if true return 0 if false
<=
return 1 if true return 0 if false
==
return 1 if true return 0 if false
<> or
!= not equal return
1 if true return 0 if false
>> shift right n
bit
4.61168601842739E18>>62 =1
<< shift left n bit (n<=62) 1<<62 =
4.61168601842739E18
&& AND test, return 1 if both result<>0 return 0 if one
of data =0
|| OR
test,return 1 if one of data <>0 return 0 if both of data =0
sin(), cos(), tan()
arcsin(), arccos(),
arctanh()
ABS()
INT(1.6)=1
ROUND(1.4)=1
ROUND(1.5)=2
ROUND(2.5)=2
ROUND(3.5)=4
FRAC(1.6)=0.6
EXP(1)=2.71828182845905
LOG10()
LOG2()
Ln()
x0210(1010)=10 bin to
dec
x1610(10) =16 hex to
dec
AND
OR
XOR
nnnnn.b =binary of
(nnnn)
Array process to manage
array data
- MIN(v1,v2,v3....)
take minimum value from those
values.
v1,v2,... could be an expression
also
example: MIN(1,2,3)
=1
- MAX(v1,v2,v3....)
take maximum value from those
values.
v1,v2,... could be an expression
also
example: MAX(1,2,3) =3
example: MAX(['&VAR:v1'], ['&VAR:v2'],
['&VAR:v3']+900)
- AVG(v1,v2,v3....)
calculate the average value from those
values.
v1,v2,... could be an expression
also
example: AVG(1,2,3)=2
-
CNT(v1,v2,v3....)
return the total count of variable
example:
AVG(1,2,3,5)=4
-
STDEVP(v1,v2,v3....)
//ITTS only
calculate The "Population Standard
Deviation
example:
STDEVP((1,2,3,4,5,6,7,8,9,10)=2.872281
-
STDEVS(v1,v2,v3....)
//ITTS
only
calculate The "Sample Standard
Deviation"
example:
STDEVS(1,2,3,4,5,6,7,8,9,10)=3.02765
- STDEVS (=STDEV
excel 2007 or earlier)
會假設它的引數為母體樣本。
如果您的資料代表整個母體,則必須 STDEV.P 來計算標準差。
標準差的計算是採用 "n-1" 方法。
- STDEVP
會假設它的引數是整個母體。
如果您的資料代表母體的樣本,
則使用 STDEV 來計算標準差。
對於較大的樣本,STDEV
與 STDEVP 會傳回大致相等的值。
標準差的計算是採用 "n" 方法。
- SORT(v1,v2,v3....); //ITTS only this is an experimental formula
please don't use.
sorting from low to highexample:
SORT(10,2,3,9,7,4,5,6,8,1)=1,2,3,4,5,6,7,8,9,10
- POS
(sub_str,main_str,v_start_search_pos)
search the
sub string's position match in main string, search position starting form
v_start_search_pos, ignore v_start_search_pos search will starting form
1
sub_str and main_str only support
smart format, (not support
expression)
v_start_search_pos (support
expression)
example:
POS(ccc,aaabbbcccddd,1)=7
example: POS(["ddd"],["aaabbbcccddd"])
=10
SIN()
COS()
TAN()
ARCCOS() ARCCOS(0) =
1.5707963267949 = (pi/2)
ARCSIN() ARCSIN(1) =
1.5707963267949 = (pi/2)
ARCTANH()
0xFF=255
0xFFFFFFFF = -1 ( expression use sign
int64 to convert )
0x80000000 = -2147483648 ( expression
use sign int64 to convert )
0x7FFFFFFF =
2147483647
In ITTS, expression support smart format.
Also you could
direct assign expression to variable or string variable:
A=1+2+3+4 variable
A=10
B:Str=ABCDE string variable
B=ABCDE
For this feature, you could direct assign some
of result data to variable in same test item, don't to add additional test
item assign the field value to variable
Example:
assign variable
a=100,
str1:str=FF
['&VAR:A']+['&STR_VAR:str1':x1610([all])] +1 =
356
If there is brance "{}" inside the process string please refer to
Brance process
Example for variable
assignment:
Example 1
variable a1 will assigned as
18
Example 2
Expression also could work with smart
format
a2 = 10 + a1 (in
Example 1, a1 was assigned as 18 )
=10+18
=28
Example 3
multiple variable assignment
you could assign many variable in one
single test item.
a1=1+2+3=6
a2=2
a3=3+a1 = 9
Example 4
Process the field
the field of Process existing
x1002(['&var:a1']):8 this will change value3 to binary code
with 8 digit
PIS field data of a1_as_bin =
00000110 ( if a1=6 )
Example 5
final answer=100+1=101
variable assignment:
a1 = 1, a2 = 2, a3 =
3
final answer in Pis result
fieeld:
x1 in field 9 =
3 (expression ['&F:3'] will get the 3'rd pos of
answer "1;2;3" =3 )
x2 in field 10 =
2 (expression ['&F:2'] will get the second pos of
answer "1;2;3" =2 )
x1 in field
9 = 11 (expression ['&F:3'] +10 will get the
first pos of answer "1;2;3" =1 then + 10
=11)
Example 6
Direct assign answer to
variable
Take the answer then calculate with
expression
also assign the processed answer to variable
a1
PIS field x
=101
variable
a1=101
Example in Delphi
in ITTS
converter_value=
['&STR_VAR:EP':X1610([1][2][3])]
// it should be setting in ITTS ini
section
in Delphi
Btn_str := 'EP:str='+Btn_str; // ex:
EP:str=FFF
strcopy(pContent,
PAnsiChar(Btn_str));
lAccessMain(pContent, 1024, PAnsiChar(Btn_str),
Expression_Process); // let ITTS get the
information EP=FFF
lAccessMain(pContent, 1024,
PAnsiChar(converter_value), Expression_Process); // process
s1 := pContent; // s1 is the
process result