Rexx - Regina

Regina is another Rexx interpreter available to compile and run Rexx programs. The official site for Regina is −

Regina Rexx Interpreter

Some of the advantages of using Regina are as follows −

  • Regina can run on any platform whether it be Windows, Linux or the Mac OS.

  • Regina works as per all available standards.

  • Regina has a big community following and hence there are a lot of forums and learning material available for Regina.

  • Regina has a lot of tools available for writing and testing Rexx programs.

  • In Regina, you can run commands which are not possible in the default Rexx Interpreter. For example, if you include certain configuration settings, you can actually run basic system level commands, which is not possible in Rexx.

When you install Rexx via the installation documented in Chapter 2 – Rexx Environment, the Regina interpreter gets installed along with it.

Now let’s see some of the common methods available when using Regina. These functions are the extended functions which are not available via normal use.

To make use of the extended functions, you need to include the following line of code. This enables the use of Regina extended functions.

options arexx_bifs 

Secondly while running all Rexx programs, use the following command.

regina main.rexx 


  • regina − This is the interpreter used for Rexx programs.

  • main.rexx − Your Rexx program.

We will now discuss in detail the various functions of Regina Rexx Interpreter.

Sr.No. Functions of Regina Rexx Interpreter
1 b2c

This method is used to convert a binary value to a string value.

2 bitcomp

The method is used to compare 2 bit strings, bit by bit.

3 bittst

This method is used to indicate the state of the specified bit in the bit string.

4 find

This method is used to search for the first occurrence of a string in another string.

5 getenv

This method returns the value of an environment variable on the system.

6 getpid

This method is used to get the value of the current running process id.

7 hash

This method returns the hash attribute of a string as a decimal number. It also updates the internal hash value of the string.

8 justify

This method is used to add justify or trim the value of a string based on the length value.

9 putenv

This method is used to set the value of an environment variable.

10 directory

This method gets the value of the current directory on the system.

11 chdir

This method changes the value of the current working directory on the system.

12 randu

This method returns a pseudo-random number between 0 and 1.