Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

REQUESTCHOICE AmigaDOS
Purpose: Enables AmigaDOS and ARexx scripts to use custom requesters.
Format: REQUESTCHOICE <title> <body> [{<gadgets>}] [TYPE INFO | QUESTION | WARNING | ERROR | INSERTDISK] [TO <variable name>] [PUBSCREEN <public screen name>] [TIMEOUTSEC <secs>] [CHARSET <charset>]
Template: TITLE/A, BODY/A, GADGETS/A/M, TYPE/K, TO/K, PUBSCREEN/K, TIMEOUTSEC/K/N, CHARSET/K
Path: C:RequestChoice
The <title> argument specifies the title of the requester.

The <body> argument specifies the text of the requester. Linefeeds can be embedded using *N.

The <gadgets> argument specifies the text for the different gadgets. The gadgets labels are separated with spaces.

The number of the selected gadget, starting with 1 for the left-most gadget if there is more than one, and 0 for the right-most gadget, is printed as a result to the console. For evaluation by a script file, the TO <variable name> argument can be used to specify an environment variable that the output is redirected to. If the requester cannot be opened, the command generates a return code of 20.

The TYPE argument specifies the type of requester to be displayed. Valid choices are "INFO", "QUESTION", "WARNING", "ERROR", and "INSERTDISK". The default is "QUESTION".

The PUBSCREEN argument can be used to specify a <public screen name> where REQUESTCHOICE allows the requester to open its window.

The TIMEOUTSECS <secs> argument specifies the maximum number of seconds to display the requester before it is closed and a result of -1 is returned. Specifying 0 timeoutsecs means no timeout.

The CHARSET <charset> argument specifies the charset of the strings given in the <body> and <gadgets> arguments. (The TITLE argument is always displayed in the charset of the screen font).

The number of the selected gadget is printed as a result to the console or written to the output file. The gadgets are numbered 1, 2, 3, ..., 0. The special result -1 is printed when the requester timed out, -2 is printed when the TYPE argument was INSERTDISK and a disk was inserted. For evaluation in a script file, you can redirect this output into an environment variable. If the requester cannot be opened, the command generates a return code of 20 when neither exec V50 nor IPrefs are running, 0 otherwise.

Example: 1

    3.OS4:> REQUESTCHOICE "Title" "My requester*nSelect a gadget" "OK" "Maybe" "Cancel"

will display the following requester:

If "Maybe" was selected the following would be displayed on the console:

    2

In this example, 1, 2, or 0 respectively would be displayed after a gadget is selected.

Example: 2

    3.OS4:> REQUESTCHOICE "Audit #" "Number in use" "New" "Reuse" "Abort" TYPE=WARNING

will display the following requester:

If "Abort" was selected the following would be displayed on the console:

    0

In this example, 1, 2, or 0 respectively would be displayed after a gadget is selected.

Example: 3

This example is more likely to be used in a script.

    3.OS4:> REQUESTCHOICE "When it's done!" "Stick at it?" "Yes" "No" TYPE=INFO TO=ENV:wit

will display the following requester:

If "Yes" was selected nothing would be displayed on the console, but ENV:wit would contain the respective value, i.e.

    3.OS4:> GETENV wit
    1

ENV:wit contains 1 or 0 respectively after the gadget is selected. The script can use this value to control its subsequent execution.

See also: REQUESTFILE, REQUESTSTRING.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.