All Topics  
ARexx

 

   Email Print
   Bookmark   Link






 

ARexx



 
 
ARexx is an implementation of the REXX
REXX

REXX is an Interpreted language programming language which was developed at IBM. It is a structured high-level programming language which was designed to be both easy to learn and easy to read....
 language for the Amiga
Amiga

The Amiga is a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer....
, written in 1987 by William S. Hawes, with a number of Amiga-specific features beyond standard REXX facilities. Like most REXX implementations, ARexx is an interpreted language
Interpreted language

In computer programming an interpreted language is a programming language whose implementation often takes the form of an interpreter . Theoretically, any language may be compiler or interpreted, so this designation is applied purely because of common implementation practice and not some underlying property of a language....
. Programs written for ARexx are called "scripts", or "macros"; several programs offer the ability to run ARexx scripts in their main interface as macros.

ARexx can easily communicate with third-party software that implements an "ARexx port".






Discussion
Ask a question about 'ARexx'
Start a new discussion about 'ARexx'
Answer questions from other users
Full Discussion Forum



Encyclopedia


ARexx is an implementation of the REXX
REXX

REXX is an Interpreted language programming language which was developed at IBM. It is a structured high-level programming language which was designed to be both easy to learn and easy to read....
 language for the Amiga
Amiga

The Amiga is a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer....
, written in 1987 by William S. Hawes, with a number of Amiga-specific features beyond standard REXX facilities. Like most REXX implementations, ARexx is an interpreted language
Interpreted language

In computer programming an interpreted language is a programming language whose implementation often takes the form of an interpreter . Theoretically, any language may be compiler or interpreted, so this designation is applied purely because of common implementation practice and not some underlying property of a language....
. Programs written for ARexx are called "scripts", or "macros"; several programs offer the ability to run ARexx scripts in their main interface as macros.

ARexx can easily communicate with third-party software that implements an "ARexx port". Any Amiga application can define a set of commands and functions for ARexx to address, thus making the capabilities of the software available to the scripts written in ARexx.

ARexx can direct commands and functions to several applications from the same script, thus offering the opportunity to mix and match functions from the different programs. For example, an ARexx script could extract data from a database
Database

A database is a structured collection of records or data that is stored in a computer system. The structure is achieved by organizing the data according to a database model....
, insert the data into a spreadsheet
Spreadsheet

A spreadsheet is a computer application that simulates a paper worksheet. It displays multiple cells that together make up a grid consisting of rows and columns, each cell containing either alphanumeric text or numeric values....
 to perform calculations on it, then insert tables and charts based on the results into a word processor
Word processor

A word processor is a computer Application software used for the production of any sort of printable material.Word processor may also refer to an obsolete type of stand-alone office machine, popular in the 1970s and 80s, combining the keyboard text-entry and printing functions of an electric typewriter with a dedicated computer for th...
 document.

History

ARexx was first created in 1987, developed for the Amiga by William S. Hawes. It is based on the REXX language described by Mike Cowlishaw
Mike Cowlishaw

Mike Cowlishaw is an IBM Fellow based at IBM UK?s Warwick location, a Visiting Professor at the Department of Computer Science at the University of Warwick, and a Fellow of the Royal Academy of Engineering , the Institute of Engineering and Technology , and the British Computer Society....
 in the book The REXX Language: A Practical Approach to Programming. ARexx was included by Commodore
Commodore International

Commodore, the commonly used name for Commodore International, was a United States electronics company based in West Chester, Pennsylvania which was a vital player in the home computer/personal computer field in the 1980s....
 into AmigaOS
AmigaOS

AmigaOS is the default native operating system of the Amiga personal computer. It was developed first by Commodore International, and initially introduced in 1985 with the Amiga 1000....
 2.0 in 1990. This later version of ARexx follows the official REXX language closely; Hawes was later involved in drafting the ANSI standard for REXX.

ARexx is written in 68000 Assembly, and cannot therefore function at full speed with new PPC CPUs, a version of ARexx has not been rewritten for them and is still missing in MorphOS
MorphOS

MorphOS is a computer operating system . It is a mixed proprietary software and open source OS produced for the Pegasos PowerPC -processor-based computer, most models of PPC-accelerator-equipped Amiga computers, and a series of Freescale development boards that use the Genesi Firmware, including the EFIKA and mobileGT....
 2.0. William Hawes is no longer involved in development of Amiga programs because of quarrels in the past with Commodore about the licensing of ARexx, and no other Amiga-related firm is financing new versions of ARexx. Notwithstanding this fact, the existing version of ARexx continues to be used, although it is not distributed with MorphOS or post-Commodore releases of AmigaOS.

Characteristics

ARexx is a programming language that can communicate with other applications. Using ARexx, for example, one could request data from a database application and send it to a spreadsheet application. To support this facility, an application must be "ARexx compatible" by being able to receive commands from ARexx and execute them. A database program might have commands to search for, retrieve, and save data — the MicroFiche Filer database has an extensive ARexx command set. A text editor might have ARexx commands corresponding to its editing command set — the Textra editor supplied with JForth can be used to provide an integrated programming environment. The AmigaVision multimedia presentation program also has ARexx port built in and can control other programs using ARexx.

ARexx can increase the power of a computer by combining the capabilities of various programs. Because of the popularity of a stand-alone ARexx package, Commodore included it with Release 2 of AmigaDOS.

Like all REXX implementations, ARexx uses typeless data representation. Other programming languages made distinctions between integers, floating point numbers, strings, characters, vectors, etc. In contrast, REXX systems treat all data as strings of characters, making it simpler to write expressions and algorithms. As is often the case in dynamically-scoped languages, variables are not declared before using them, they come into being on their first use.

ARexx scripts benefit from an error handling system which monitors execution and responds accordingly. The programmer can choose to suspend and resume the execution of the program as needed.

The ARexx command set is simple, but in addition to the commands there are the functions of its Amiga reference library (rexxsyslib.library). It is also easy to add other libraries or individual functions. ARexx scripts can also be invoked as functions from other ARexx scripts. Any Amiga program which has an ARexx port built in can share its functions with ARexx scripts.

Examples of ARexx solutions to common problems


Lack of features in a program


If end user is using a program which builds animations by joining various bitmap image files but which lacks image processing capabilities, he could write an ARexx script which performs these actions:

  1. ARexx locates the image files in their directories
  2. ARexx loads first image
  3. ARexx loads paint program
  4. The image is loaded into paint program which performs modifications to file
  5. The modified image is stored into another directory
  6. ARexx repeats procedure on any image in the directory
  7. The paint program is closed and the animation program is loaded
  8. The animation is built
  9. The animation is saved in its directory
  10. The animation program is closed


Avoiding repetitive procedures


EqFiles.rexx is a well known example of a simple ARexx script written to automate repetitive and boring procedures. This script uses the ALeXcompare program to compares files, and then finds all duplicates in a set of files and returns output by highlighting any results in a different color.

Expand AmigaOS capabilities


One of the main features of ARexx is the fact it could expand the capabilities of an OS (AmigaOS) by adding some procedures the OS lacked. For example a simple ARexx program could be written to print a warning message on the screen of the monitor, or play an audio alert signal if a certain Amiga program stops, faults or has finished its scheduled job.

The following script is a very minimal ARexx script that displays warnings on the monitor screen depending on events that take place.

/* Alarm.rexx */

ARG event

IF event = 0 THEN EXIT IF event = 1 THEN SAY "Program has ended unexpectedly" IF event = 2 THEN SAY "Program has finished its job" IF event = 3 THEN SAY "Cannot find data in selected directory"

See also

REXX
REXX

REXX is an Interpreted language programming language which was developed at IBM. It is a structured high-level programming language which was designed to be both easy to learn and easy to read....


External links

  • [ftp://ftp.aminet.net/docs/help/arexxreference.lha Command and Function Reference]