Rope Language Reference - "reg"

The "reg" action returns a reference to the numbered user register. This allows the "$a" through "$z" to be accessed as if they were part of a 26-element array.

This means that "$a" and "reg(1)" are equivalent, as are "$d" and "reg(4)".

For example - ways of setting $f to "hello"..

put( "hello" $f )
put( "hello" reg(6) )
"hello" $f put
"hello" 6 reg put

Or - ways of printing the contents of $b..

print(get(reg(2)))
2 reg get print
2 reg print

Change History

The "reg" action was introduced in Rope versions after 1st Jan 2005 (20050101).

See Also

get, put, greg