ARexx

from Wikipedia, the free encyclopedia
ARexx
Basic data

developer William S. Hawes
Publishing year 1987
Current  version 1.15 (internal 53.4)
(February 21, 2013)
operating system AmigaOS
programming language ANSI C , hand-optimized
category Scripting language
License proprietary
German speaking No

ARexx is an implementation of the REXX programming language for the Amiga computer and was developed in 1987 by William S. Hawes. Like REXX, ARexx is an interpreter- based programming language. Programs that are developed in ARexx are called script or macro programs.

Most Amiga programs have the option of executing ARexx scripts in order to expand the range of functions or to guarantee individual problem solutions via the ARexx port.

With ARexx there is the possibility that two programs can communicate with each other via their respective ARexx port in order to be able to use the other functions of the program.

For example, an ARexx script can get information from a database, which is then transferred to a spreadsheet so that the final result can be transferred automatically to a word processing program. ARexx is primarily used to automate repetitive processes.

history

ARexx was developed in 1987 by William S. Hawes of Wishful Thinking Development and was used around 1990 with the OS2.04 by Commodore on the Amiga. ARexx is essentially based on REXX, which was developed by Mike Cowlishaw at IBM in the 1980s for mainframes on CMS operating systems. ARexx does not differ rudimentarily from the IBM REXX language, although it was written specifically for Amiga and its environment. Since OS3.5, the Amiga Workbench has offered its own ARexx port, via which system functions can be used by ARexx.

How does ARexx

ARexx is an interpreter-based language. ARexx scripts are therefore not translated into machine language before execution, but are parsed and interpreted by the RexxMaster interpreter at runtime. This means that the scripts can be used immediately, but they also work relatively slowly and always require the interpreter to be executed. Since ARexx works without data types, each variable can be a text, a number or any character string, whereby these variables do not have to be declared in advance. The RexxMast reads ARexx scripts as text files and executes them command by command. RexxMast automatically controls the resources and catches errors. ARexx uses the AmigaOS- own environment and uses its multitasking, the installed libraries as well as the process communication. For this purpose, messages are sent between the message ports provided by a program, which are then picked up and processed by the respective program. The following order is observed:

  • When the program starts, an application program opens a message port
  • the program is waiting to receive a message
  • the operating system informs the program that a message has been sent to its message port
  • the program performs the requested action
  • the program informs the sender of the message that the message has been received and processed. Either a return value is provided or the requested data is sent.

The instruction set of ARexx is kept very simple and mainly uses commands to manipulate strings (character strings). However, since there are a number of additional extensions for ARexx, it is even possible to create a program interface ( GUI ) using ARexx in order to get in direct contact with the user in order to receive inputs or queries.

Structure of an ARexx script

Every ARexx script consists of at least one comment line, whereby the script (for historical reasons) must always start with a comment line:

/* Dies ist mein Programm */

This comment line informs the RexxMast that the present script is an ARexx script. Further comment lines are ignored by RexxMast, but of course they are used for clarity, especially if you want to edit the script yourself again after weeks or months.

The actual program then begins after the comment line:

SAY "Hallo Welt"

In this case the text "Hello World" would be displayed on the console.

Internal or external ARexx commands

ARexx offers an extensive library of predefined functions. These functions are always available and optimally matched to the internal data structure of the AmigaOS, which is why they sometimes differ greatly from the REXX instruction set or cannot be found there (example: ADDLIB ()).

In addition to these predefined functions, there is a large number of additional libraries that significantly increase the functional scope of ARexx. These additional libraries are loaded from the ARexx script and are then available. Here are some examples:

  • rexxreqtools.library
Extends ARexx so that files, directories and fonts can be selected via selection windows.
  • tritonrexx.library
Allows to create graphical interfaces (GUI) using ARexx.
  • rexxtricks.library
Offers functions to use Amiga-DOS, SCSI, screen and pictogram functions via ARexx.

However, this is only a small glimpse of the existing libraries with which ARexx can be expanded.

Compile ARexx scripts

It was widely believed that it was possible to compile ARexx scripts. There were programs like Rexx Plus, RexxMasher and ExecRexx for this. The last two programs weren't compilers, they just removed all comment lines from the script, encoded the script, and added a program to run the script. When the program started, the script was decoded again and the RexxMast was still necessary to run it. However, by removing the comment lines it could happen with very extensive ARexx scripts that the "coded" script no longer worked properly.