blob: b77806dcff7511a2352f7348571fdbe254018485 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#
# PRE: foreach if-multivalue
#
update {
&reply:Filter-Id := 'filter'
&control:Tmp-String-0 := '0'
&control:Tmp-String-0 += '1'
&control:Tmp-String-0 += '2'
&control:Tmp-String-0 += '3'
}
foreach control:Tmp-String-0 {
update control {
Tmp-String-0 -= "%{expr:%{Foreach-Variable-0} + 1}"
}
update request {
Tmp-String-0 += "%{Foreach-Variable-0}"
}
}
if (!&Tmp-String-0[0] || !&Tmp-String-0[1] || !&Tmp-String-0[2] || !&Tmp-String-0[3]) {
update reply {
Filter-Id += 'Fail 0'
}
}
if ((&Tmp-String-0[0] != '0') || (&Tmp-String-0[1] != '1') || (&Tmp-String-0[2] != '2') || (&Tmp-String-0[3] != '3')) {
update reply {
Filter-Id += 'Fail 1'
}
}
if (!&control:Tmp-String-0[0] || &control:Tmp-String-0[1] || &control:Tmp-String-0[2] || &control:Tmp-String-0[3]) {
update reply {
Filter-Id += 'Fail 2'
}
}
|