四則運算
運算結果參照例程:Arithmetic
R1 := 5 * 5
R2 := [5] * [5]
R3 := [1,2,3] * 2
R4 := [1,2,3] * 2.1 + 10
R5 := [1,2,3] * [1,2,3]
R6 := 'Text1' + 'Text2'
R7 := 17.23 + 'Text'
R8 := 'Text1 ' + 99 + ' Text2'
R9 := 'Text ' + 3.1 * 2
R10 := 3.1 + 2 + ' Text'
R11 := 3.1 + (2 + ' Text')
R12 := 'Text ' + 2.1 + 3
ThatIsAnError := 3.1 * (2 + ' Text')
ThatIsAnError := [1,2,3] * [1,2]
Tuple元素值的分配和變量的賦值
運算結果參照例程:assign
Tuple1 := [1,0,3,4,5,6,7,8,9]
Val := sin(1.2) + cos(1.2)
Tuple1[1] := 2
Tuple2 := []
for i := 0 to 10 by 1
Tuple2[i] := i
endfor
位操作
運算結果參照例程:bit
Number := 128
LShift := lsh(Number,2)
RShift := rsh(Number,2)
Select := Number band 1
Select := 127 band 4
Set := 127 bor lsh(1,7)
變量的比較操作
運算結果參照例程:compare
R1 := 1 = 1.0
R2 := [] = []
R3 := '' = []
R4 := [1,'2'] = [1,2]
R5 := [1,2,3] = [1,2]
R6 := [4711,'Hugo'] = [4711,'Hugo']
R7 := 'Hugo' = 'hugo'
R8 := 2 > 1
R9 := 2 > 1.0
R10 := [5,4,1] > [5,4]
R11 := [2,1] > [2,0]
R12 := 'Hugo' < 'hugo'
R13 := true > false