Key Pages: [ Rope Home Page | Basics (tutorial) | Language Reference | Download ]
The "greg" action returns a reference to one of the available global registers (greg stands for "global register"). It takes an integer value off the stack and returns a reference to the numbered global integer register. You can use this reference to get or put their values.
Rope "global registers" are integer registers who's values are available to all Rope scripts (ie "public") via the "greg" action, and to "user" mode programs via files in the /proc file system. The values are not reset between Rope script executions.
Note that..
To get the contents of global register number 5..
5 greg get print greg(5) get print greg(5) print
The last of these examples works because many of Rope's actions (including print) execute an implied get when they are passed a register reference.
To setthe value of global register number 5 to value 29, use one of..
put( 29 greg(5) ) 29 greg(5) put 29 5 greg put
The "greg" action is not available in Rope versions before 20050101 (Jan 2005).
Lowth.com: [ Home | Rope | P2PWall | LinWiz | cutter | Protector - Free Antivirus software | TapeIO ]