Next: Compound Statements, Previous: Types, Up: The Poke Language [Contents][Index]
The assignment statement has the form:
lvalue = exp;
where lvalue is either:
foo.bar
.
foo[30]
.
int @ 0#B
or int[3] @ 0#B
or Packet @ 12#B
.
In all cases, the type of exp should match the type of the referred entity.
Examples:
(poke) foo = 10 (poke) packet.length = 4 (poke) packet.data = [1,2,3,4] (poke) packet.data[2] = 666 (poke) int @ 23#B = 23 (poke) string @ str.offset = "foo" (poke) int[2] @ 23#B = [1,2] (poke) Packet @ 0#B = Packet { … }