Changes from ARexx 1.06 to ARexx 1.10 This file summarizes the changes made between ARexx V1.06 and V1.10. If you've received this disk as an upgrade from ARexx 1.06, you may wish to review the changes summarized here; otherwise you should proceed to the "Update.doc" file. Speedier Operation. The new ARexx is much faster ... most ARexx programs should run 3-4 times as fast with this version, depending on the nature of the program. The greatest increases will occur for programs with lots of loops and mostly integer math. CLI Structure. Each ARexx task is now given a CLI structure so that ADDRESS COMMAND will have a directory and path to inherit. ARexx uses an inheritance mechanism whereby the task will inherit the path from its client if the client has a CLI structure, and otherwise uses the RexxMaster's path. In the latter case, the path is that in effect when "rexxmast" is run, by analogy with WorkBench. The CLI structure is kept synchronized with the changes made to the current directory via Pragma('D',dirname). Failure Level for Commands. Each ARexx task initializes its command failure level to the client's failure level (usually 10), and this level controls reporting of command errors. This will help suppress printing of nuisance command errors. The failure level can be changed using OPTIONS FAILAT as before. Command errors (RC > 0) and failures (RC >= failat) can be separately trapped using SIGNAL ON ERROR and SIGNAL ON FAILURE. DO Instruction. The "DO " form of the DO instruction is now implemented. If a FOR limit is also present, the initial expression is still evaluated, but the result need not be a positive integer. Example: "do 5;say hi;end" TRACE Instruction. A new trace option called "Background" is now available. TRACE BACKGROUND is like TRACE OFF except that it can't be changed by external tracing. This allows well-tested ARexx programs to run in the background without being affected by the external tracing flag set by the TS command. --- Built-In Functions --- Several new functions have been added to the built-in function library, and some additions or corrections have been made to others. ARG() Built-In Function. A bug in ARG() whereby the argument count was reported as 1 instead of 0 has been fixed. D2X() Built-In Function. The new D2X(number,[digits]) function converts a decimal number to hexadecimal. DATE() Built-In Function. The popular DATE() last-day-of-the-month bug has been fixed. In addition, the DATE() function now accepts optional second and third arguments to supply the date either in the form of internal system days or in the 'sorted' form YYYYMMDD. The second argument is an integer specifying either system days (the default) or a sorted date; the third argument specifies the form of the date and can be either 'I' or 'S'. The current date in system days can be retrieved using DATE('Internal'). Examples: duedate = date('s',date('i')+21) future = date('w',19970601,'S') FIND() Built-In Function. The new FIND(string,phrase) function locates a phrase of words in a larger string of words and returns the word number of the matched position. Example: say find('Now is the time,'is the') --> 2 INDEX() Built-In Function. A bug in the INDEX() function was fixed. OFFSET() Built-In Function. The OFFSET() function has been moved to the support library. POS() Built-In Function. A bug in the POS() function was fixed. PRAGMA() Built-In Function. The PRAGMA() function has several new options. -- PRAGMA('*',name) defines the specified logical name as the current ("*") console handler, thereby allowing the user to open two streams on one window. -- PRAGMA('W',{'Null' | 'WorkBench'}) controls the task's WindowPtr field. Setting it to 'Null' will suppress any requestors that might otherwise be generated by a DOS call. -- PRAGMA('D') is equivalent to PRAGMA('D',''); it returns the pathname of the current directory without changing the directory. SHOW() Built-In Function. The SHOW('P') option has been changed to agree with the documentation. It now returns the names on the system ports list (like SHOWLIST('P')). You can check for the existence of a host using SHOW('P',address()). The internal ports list (less often used) is now selected by SHOW('Internal'). TIME() Built-In Function. A bug in the TIME('C') function was fixed that incorrectly reported times such as ``12:30PM'' as ``12:30AM''. X2D() Built-In Function. The new function X2D(hex-digits,[length]) converts hexadecimal digits to a decimal number. --- REXX Support Library --- A bug in the support library that caused a software error under certain circumstances has been fixed. It usually happened when a call was made to the support library immediately following a call to SETCLIP(). BADDR() Support Function. The new BADDR(BPTR) function converts a BPTR to a real address. DELETE() Support Function. The new DELETE(filename) function deletes a file or directory. FORBID() Support Function. Task switching can be controlled by calls to FORBID() and PERMIT(). The return value is the current nesting count (or -1 if task switching is enabled). Since ARexx programs run as separate tasks, no harm is done if the program ends with task switching forbidden. MAKEDIR() Support Function. The new MAKEDIR(dirname) function creates a new directory and returns a boolean result. Note that the function does not return an error if the directory already exists, so the call can be made to ensure that a directory exists. NEXT() Support Function. The new NEXT(address,[offset]) function returns the 4-byte value at the address (plus offset). It can be used to follow a EXEC list forwards as NEXT(address) or backwards as NEXT(address,4). NULL() Support Function. The new NULL() function returns a null pointer as a 4-byte string ('0000 0000'x). OFFSET() Support Function. The OFFSET() function has been moved from the built-in library to the support library. PERMIT() Support Function. Task switching can be controlled by calls to FORBID() and PERMIT(). The return value is the current nesting count (or -1 if task switching is enabled). Since ARexx programs run as separate tasks, no harm is done if the program ends with task switching forbidden. RENAME() Support Function. The new RENAME(oldname,newname) function renames a file and returns a boolean result. SHOWLIST() Support Function. The SHOWLIST() function has been extended to accept an optional fourth keyword argument 'Address'. The 'Address' option specifies that the function is to return the address of the located node, and is valid only if a node name (second argument) has been supplied. The 'Address' option is valid for both EXEC and DOS lists; the latter are returned as machine addresses rather than as BPTRs. DOS list names are always reported in uppercase, and the supplied node name should be in uppercase. Example: SHOWLIST('L','exec.library',,'A') --> '0000 0676'x WAITPKT() Support Function. A bug in WAITPKT() was fixed that sometimes caused queued messages to be ignored. --- REXX Server (RexxMast) --- The REXX server no longer opens its silly little window; it sends the copyright notice to the standard output stream (or NIL:) as desired. RexxMast is now smarter about the IEEE library; it attempts to open it first and provides an intelligible error message if the library can't be opened. The REXX server now supports an additional host port (named "AREXX") for launching asynchronous commands. A command sent to the AREXX port will return immediately without indicating an error, making it roughly the same as a "run rx " or "runwsh " but without the overhead of an extra CLI process.