Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
2 user(s) are online (1 user(s) are browsing encyclopedia)

Members: 0
Guests: 2

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

AREXX

ARexx is the Amiga version of scripting language REXX by IBM. It has been not licensed from IBM, but it is a version written by Bill Hawes who ported REXX to the Amiga, with many special Amiga features.

Technically speaking ARexx is an interpreted language for scripting. This means it should be already active in memory in order to interpret and run any program loaded by the users.

A program written in this language (called either script (computer programming) or macro ) could be largely applied to expand features and functionality of an Operating System or also to increase the features and capabilities of a productivity program.

Because of its easiness of use ARexx is strongly recommended to learn fundamental programming techniques. Although of its simplicity ARexx also has a place in the hearts of experienced programmers because large part of them uses ARexx due to its elasticity and integration in the AmigaOS.

End users of a productivity program could find in ARexx a valuable tool which can help them in personalizing their work environment.

ARexx it is also useful in exchange data and files between programs in order to take advantage of features that are present only in one certain application and absent in others, or even literally borrow any feature from any program while using another one.

Finally the end user could also benefit of the capability of ARexx in built automated macros to perform scheduled work even in his absence and avoid repetitive procedures.

= History =

ARexx was born in 1987, being developed for the Amiga by William Hawes. It is based on the REXX language described by into AmigaOS 2.0 in 1990. It follows official REXX language very closely.

Almost any modern Amiga program has currently an ARexx port and could exchange data with other programs or use ARexx to automate its internal functions and procedures. Even the Workbench graphical user interface (GUI) of Amiga shares an ARexx port, and the commands of AmigaDOS have a strong compatibility with ARexx.

Development of ARexx is currently stopped because ARexx is written in 680x0 Assembly, and it must be rewritten in order to function properly with new PPC CPUs. Also William Hawes is no more involved in development of Amiga programs because of some quarrels he had with the passed Commodore Inc about the licensing of ARexx. Not to mention the fact there is no Amiga related firm who has interest in financing for new versions of ARexx. Notwithstanding this fact the existing version of ARexx performs flawlessly and has no major bug, so none has yet upgraded it.

Some times ago Amiga programmers and users have experienced positively with Python programming language. Python is raising recently the interest by Amiga community and is one of the major candidates in succeeding ARexx as integrated language for scripting and expanding functions of OS in AmigaOS environment.

= 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 spread sheet 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. MicroFiche Filer is an example of a database program with an extensive ARexx command set. A text editor might have ARexx commands corresponding to its editing command set. For example The Textra editor supplied with JForth has an extensive ARexx command set, which can be used with JForth to provide an integrated programming environment . AmigaVision, the 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 wide acceptance of ARexx, Commodore includes it with Version 2.0 of AmigaDOS. If you are an Amiga programmer who is developing an application, it is highly recommended that you provide ARexx compatibility, if appropriate, by inserting an ARexx port in your program.

ARexx uses typeless data representation. Other programming languages made distinctions between integers, floating point numbers, strings, characters, vectors, etcetera. On the contrary ARexx deals with all data as strings of characters, making more simple to write expressions and algorithms. It is not necessary to declare a variable before using it. This feature is typical in a large number of interpreted languages, i.e. the languages in which dynamic data (data that exist during program execution) is exclusive matter of the interpreter.

Being an interpreted language ARexx has no necessity of any complicated compiler, linker, debugger or development environment. It has a very simple internal mechanism of execution step by step of its programs, so anyone could control how execution is performed and correct errors right on the fly. This feature is very useful to increase speed of development of any program and is invaluable for any non experienced user.

All ARexx scripts have to deal with a very complete and sophisticated error handling system which is monitoring any error could occur during execution. The user could choose in any situation to suspend and resume the execution of the program.

ARexx interpreter gives to the user a simple but powerful system to handle resources. It frees the memory allocated for the variables when an ARexx program ends its execution, it closes open files and the libraries that the program used, etcetera.

ARexx is an imperative language, i.e. it is based on the execution of instructions in a sequence. It is oriented to a structured, procedural and modular programming. ARexx command set is very poor, but side to the commands are lying the functions of its Amiga reference library (rexxsyslib.library). It is also very simple to add other libraries to ARexx base library o add any new function that could help the programmer. ARexx scripts could also be invoked as functions into other ARexx scripts.

Any Amiga program which has an ARexx port built into, could be used by ARexx to pick any function, procedure or feature and share it with ARexx scripts. This means that ARexx deals with any program which has an ARexx port built into as an entire new set of available commands.

Finally ARexx has been built to integrate with the Amiga OS system in order to deal at its best with Amiga preemptive multitasking capabilities.

== Examples of ARexx solutions to common problems ==

Example 1: Lack of features in a program and repetitive procedures

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

ARexx locates files in their directory/directories -> ARexx loads first image -> it loads paint program -> image is loaded into paint program which performs modifications to file -> modified image is stored into another directory -> ARexx repeats procedure on any image in the directory -> paint program is closed and animation program is loaded -> animation is build -> animation is saved in its directory -> animation program is closed -> user could be prompted that job is finished -> end of ARexx script

Example 2: Avoiding repetitive procedures

[http://main.aminet.net/util/rexx/EqFiles.lha EqFiles.rexx V2.2] is a common example of a simple ARexx script written by an experienced Amiga user who wants to automate repetitive and boring procedures and has enough skills and knowledge of AmigaOS to write such an ARexx program. This REXX script uses another program present in aminet repository [http://main.aminet.net/util/cli/ALeXcompare.lha ALeXcompare] which compares files. EqFiles finds all duplicates in any set of files and returns output by highlighting any results in a different color.

Example 3: 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 lack of. 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.

Here follows an example of the structure of a very minimal ARexx script (not correct or debugged and with no arguments and no calls to AmigaDOS) which should print on monitor screen some alarm warnings depending by an event that could take place or not.

Alarm.rexx

/* 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

Example 4: Parse data

ARexx is a program very powerful to parse data and transfer data between a program and another. Because of its internal typeless data representation ARexx could be used (for example) to retrieve data from a database file, read any record, avoid internal marks and special characters and send only valid data to a spreadsheet application putting any single invoice of the database in a single cell.

[Characteristics section is almost complete. It could be expanded by add some infos regarding main files of ARexx language and about the programs required to a correct installation]

= Notes =

ARexx is also included in MorphOS Operating System. The Morphos version of ARexx has been completely rewritten for PPC family of CPUs.

Incidentally we know the name of the experienced user who wrote this ARexx script because he decided to share his script with the whole Amiga community, so he published it on Aminet internet Amiga repository. He is a well known experienced user in both the Amiga and MorphOS communities: [http://it.wikipedia.org/wiki/Fulvio%20Peruggi professor Fulvio Peruggi]. He is also author of various articles regarding Amiga and MorphOS.

ALeXcompare was written by the programmer Alex Kazik