Debian Codegraph @

tests/helper138.pe

raw
1 # Inputs to functions are passed by reference
2 Print("input:", $1)
3
4 copy2 = $1
5
6 $1[0] = 10
7 $1[1] = 11
8 $1[2][0] = "reference"
9 $1[2][1] = "passed"
10 Print("updated:", $1)
11
12 if ($1[0] != 10)
13 Error("Bad array value helper 1")
14 elseif ($1[1] != 11)
15 Error("Bad array value helper 2")
16 elseif ($1[2][0] != "reference")
17 Error("Bad array value helper 3")
18 elseif ($1[2][1] != "passed")
19 Error("Bad array value helper 4")
20 endif
21
22 $1 = "abcdef"
23 Print("assigned:", $1)
24
25 Print("copy2:", copy2)