Other common ARexx commands

These commands aren't applicable for every program, but please use them if your program provides this sort of functionality.

Cursor Positioning Commands

GOTOLINE /N/A
This command moves the cursor to a specified line.

GOTOCOLUMN /N/A
This command moves the cursor to a specified column.

CURSOR UP/S/,DOWN/S,LEFT/S/RIGHT/S
CURSOR moves the cursor up, down, left or right a single line or column position.

LINE /N/A
LINE accepts positive or negative arguments to move the cursor up or down relative to its current position.

COLUMN /N/A
COLUMN accepts positive or negative arguments to move the cursor left or right relative to its current position.

NEXT WORD/S,SENTENCE/S,PARAGRAPH/S,PAGE/S
NEXT moves the cursor to the next word, sentence, paragraph or page.

PREVIOUS WORD/S,SENTENCE/S,PARAGRAPH/S,PAGE/S
PREVIOUS moves the cursor to the previous word, sentence, paragraph or page.

SETBOOKMARK /N
This command is used to remember a place in text. If the program supports multiple bookmarks, a number can be used to differentiate them.

GOTOBOOKMARK /N
Move cursor to a bookmark. If the program supports multiple bookmarks, a number can be used to differentiate them.

These other ARexx commands are presented to avoid conflicts among those applications that do support ARexx commands with similar functions or names.

POSITION SOF/S,EOF/S,SOL/S,EOL/S,SOW/S,EOW/S,SOV/S,EOV/S
POSITION moves the cursor to the position specified by the argument.

Find and Replace Commands

FIND TEXT/F
FIND searches for text that matches the specified string. If no string is specified on the command line, a requester should be presented allowing the user to enter a search string.

FINDCHANGE ALL/S,PROMPT/S,FIND/K,CHANGE/K

FINDNEXT
This moves the cursor to the next occurance of the current search string without displaying a requester.

Other Text-Related Commands

TEXT TEXT/F
This command can be used in ARexx macros, allowing text to be entered via a command and honouring word wrap, insertion or any other current modes.

UPPERCASE, LOWERCASE, SWAPCASE CHAR/S,WORD/S,LINE/S,SENTENCE/S,PARAGRAPH/S
These three commands can be used if your program has the ability to swap the case of a letter or letters. The default switch should be WORD.

FONT NAME/S,SIZE/N,ITALIC/S,BOLD/S,PLAIN/S,UNDERLINED/S
Use this command if your application supports font selection. A combination of the text style arguments should be allowed following the SIZE argument

UNDO /N
This command reverts back to the last state of the project. If your program supports multiple levels of undo, a number should be recognized as an argument. The default should be one level of undo.

REDO
For applications with multiple levels of UNDO, REDO will allow the user to undo the UNDO command. See Chapter 6 for more information.

Window-related Commands

MOVEWINDOW LEFTEDGE/N, TOPEDGE/N
This command should be used to change the position of a window. An argument of -1 means no change or don't care. Your application should either do the best job it can to move the window to the specified position, or return an error code.

SIZEWINDOW WIDTH/N, HEIGHT/N
This command should be used to change the size of a window. An argument of -1 means no change or don't care. Your application should either do the best job it can to size the window or return an error code.

Since ARexx is a standard language on the Amiga, and since it is used across applications, the command names given here are considered to be reserved for the function listed with the name.

CHANGEWINDOW LEFTEDGE/N, TOPEDGE/N, WIDTH/N, HEIGHT/N
This command is similar to MOVEWINDOW and SIZEWINDOW but the application should move and size the window as one operation. This is important to the user because moving a window to a new size and position can require as many as three commands, depending on the original position and size as well as the target position and size.

WINDOWTOFRONT
This command moves a window to the front.

WINDOWTOBACK
This command moves a window behind all others.

ACTIVATEWINDOW
This command activates a window.

ZOOMWINDOW
If your program supports zoom gadgets on your windows, use this command to make a window small.

UNZOOMWINDOWS
If your program supports zoom gadgets on your windows, use this command to unshrink it.

Telecommunications Commands

BAUD /N
This command sets the baud rate.

PARITY EVEN/S, ODD/S, NONE/S
Use this command to set the parity.

STOPBITS 1/S,0/S
Use this to set the stopbits.

DUPLEX FULL/S,HALF/S
Use this to set the duplex mode.

PROTOCOL /K
Use this command to set the protocol.

SENDFILE NAME/K
Use this to start a file send. If the filename is omitted, the user should be presented with a file requester.

CAPTURE NAME/K
Use this to open a capture buffer. If the filename is ommitted, the user should be presented with a file requester.

DIAL NUM/F
Use this command to dial a phone number.

REDIAL
Use this to redial the last phone number.

SEND
Use this to send a text string.

WAIT
Use this to wait for a text string.

TIMEOUT /N
Use this to set the timeout value (in seconds) for waits.

Miscellaneous Commands

TEXTPEN , BACKGROUNDPEN /N
Text-oriented applications that support the ability to set pen and paper colours can use these two commands. Valid values should be bounded by the screen's maximum number of colours rather than by existing Amiga hardware.

LOCKGUI
This inhibits the graphical user interface of the application.

UNLOCKGUI
This undoes LOCKGUI, allowing GUI events to resume.

GETATTR OBJECT/A, NAME, FIELD, STEM/K ,VAR/K
GETATTR obtains information about the attributes of an object.

In the above OBJECT argument, the user could be seeking information on the attributes of any of the following items:

If the destination variable is a stem variable, the following fields are recommended:

APPLICATION would consist of the following nodes (an aspect of APPLICATION that the user can seek sub-information about):

PROJECTS.COUNT would contain the number of projects; PROJECTS.0 through PROJECTS.n would contain the handle for the project.

PROJECT would consist of the following nodes. Other variables could be added based on the type of application. For example, a text editor could add a variable called .LINES that would contain the number of lines in the project's file.

WINDOWS.COUNT would contain the number of windows; WINDOWS.0 through WINDOWS.n would contain the handle for the window.

WINDOW would consist of the following nodes:

SETATTR OBJECT/A, NAME, FIELD, STEM/K, VAR/K
SETATTR manipulates the aspects of an object.

WINDOW NAMES/M, OPEN/S, CLOSE/S, SNAPSHOT/S, ACTIVATE/S, MIN/S, MAX/S, FRONT/S, BACK/S
WINDOW allows the user to manipulate several aspects of the window.

CMDSHELL OPEN/S, CLOSE/S

CMDSHELL opens a command shell so the user can interact directly with the application at a command level.

CMDSHELL allows the user quick access to infrequently used functions or macros that are not bound to a key, menu or button.

ACTIVATE
ACTIVATE starts the GUI of an application. This involves "de-iconifying" it, bringing its screen to the front, unzooming the main window (ie. expanding it to its previously set size) and making that window active.

DEACTIVATE
This command shuts down the GUI of an application. DEACTIVATE restores the GUI to the state it was in before receiving the ACTIVATE command.

DISABLE NAMES/M
This command disables a command or list of commands. DISABLE should also disable any user interface items to which the command is bound. For example, if a command is bound to a gadget, then that gadget should be disabled as well. This command should support pattern expansion.

ENABLE NAMES/M

ENABLE makes a command or a list of commands available to the user. ENABLE should also enable the GUI items to which they are bound (see DISABLE). This command should support pattern expansion.

LEARN FILE/K, STOP/S
LEARN allows the application to build an ARexx macro consisting of the actions the user performs.

ALIAS NAME/A, COMMAND/F
ALIAS assigns a user-definable name to a function and its options.

SELECT NAME/A, FROM/K, NEXT/S, PREVIOUS/S, TOP/S, BOTTOM/S
SELECT is used to select an object from a list of similar objects. The main use for this command is to allow the user to select the current project from a list of projects. Returns the name of the current project.