AmigaOS 4.0 - About OS4 - Commands
|
||||||||
|
||||||||
|
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:
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:
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:
3.OS4:> GETENV wit 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.
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. |