ROPE Registers

Rope supports the idea of "registers" - these are pretty much the same as scalar variables in perl or C.

Register References

When a Rope script refers to a user or "internal" register using a dollar character before the register name, Rope actually pushes a value onto the stack that is a reference to the register that was named.

The get action is used to collect the value contained in that register. For example, the following code puts the contents of $a onto the stack. Without the "get" the stack would contain a reference to $a instead of it's value.

$a get

The same logic is also used to collect the values of internal registers, for example.

$ip_saddr get

Rope actions that want to see values on the stack rather than register references perform a "get" internally, so that the following are equivalent:

$x print
$x get print

Some (but by no means all) registers can have their values changed using the "put" action, like this..

20 $x put
put( 13 $offset )

The reg and greg actions provide an alternative way of getting a register reference.

See Also

get, put, inc, dec, integer, string, block, reg, greg