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.
- SOF moves it to the beginning of the file.
- EOF moves it to the end of the file.
- SOL moves it to the beginning of the current line.
- EOL moves it to the end of the current line.
- SOW moves it to the start of the current word.
- EOW moves it to the end of the current word.
- SOV moves it to the top of the current view.
- EOV moves it to the bottom of the current view.
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
- PROMPT brings up a requester.
- FIND searches for the string specified after the keyword.
- CHANGE replaces the specified FIND string with the string specified after the CHANGE keyword.
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.
- OBJECT specifies the object type to obtain information on.
- NAME specifies the name of the object.
- FIELD specifies which field should be checked for information.
- STEM (keyword) specifies that the information is to be placed in the following stem variable rather than the RESULT field.
- VAR (keyword) specifies that the information is to be returned in a simple variable.
In the above OBJECT argument, the user could be seeking information on the attributes of any of the following items:
- APPLICATION
- PROJECT <name>
- WINDOW <name>
- PROJECTS
- WINDOWS
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):
- .VERSION Contains the current version information for the application.
- .SCREEN Contains the name of the screen that the application resides in (if the screen is public).
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.
- .AREXX Contains the ARexx port assigned to the project.
- .FILENAME Contains the complete filename of the project.
- .PATH Contains the path portion of the filename.
- .FILE Contains the file portion of the filename.
- .CHANGES Contains the number of changes made to the project (since last save).
- .PRIORITY Priority at which the project's process is running. Allows the user to set the priority. For example, a 3-D modelling application could be working on several different projects at one time. Using this field, the user would be able to give more time to the most important project.
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:
- .LEFT Left edge of the window.
- .TOP Top edge of the window.
- .WIDTH Width of the window.
- .HEIGHT Height of the window.
- .TITLE Window title.
- .MIN.WIDTH Minimum width of the window.
- .MIN.HEIGHT Minimum height of the window.
- .MAX.WIDTH Maximum width of the window.
- .MAX.HEIGHT Maximum height of the window.
- .SCREEN Name of the screen in which the window resides.
SETATTR OBJECT/A, NAME, FIELD, STEM/K, VAR/K
SETATTR manipulates the aspects of an object.
- OBJECT specifies the object type to manipulate.
- NAME specifies the name of the object.
- FIELD specifies which field should be modified.
- STEM specifies that the information is to be
- extracted from the following stem variable.
- VAR specifies that the information is to be extracted from the following simple variable.
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.
- NAMES specifies a list of windows to manipulate. This command should support wildcard expansion.
- OPEN is used to indicate that the window(s) should be opened.
- CLOSE is used to indicate that the window(s) should be closed.
- SNAPSHOT records the current position and size of the named window(s).
- ACTIVATE will make the window the input focal point.
- MIN sets the named window(s) to the minimum size.
- MAX sets the named window(s) to the maximum size.
- FRONT places the named window(s) in front of other windows.
- BACK places the named window(s) behind all others.
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.
- FILE specifies the name of the file in which the user will save the commands.
- STOP tells the application to stop learning.
ALIAS NAME/A, COMMAND/F
ALIAS assigns a user-definable name to a function and its options.
- NAME specifies what the new command will be called.
- COMMAND represents the rest of the line where the command and whatever options are to be bound to that command are entered.
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.
- FROM specifies the list from which the user can select. The default should be the main project list.
- NEXT specifies that the next object on the list should be selected.
- PREVIOUS specifies that the previous object on the list should be selected.
- TOP specifies that the first object on the list should be selected.
- BOTTOM specifies that the last object on the list should be selected.