PROMPT
A user query accessory for use with r4™

1 Categories:

visual accessory, user query accessory

2 Description:

The PROMPT accessory is used by r4™ programs to acquire a response to a question. The response value is returned in the system registry.

Since multiple r4™ programs can be active at the same time, the name of the system registry is passed as a value in the command line. This allows each r4™ program to receive an independent response value. The r4™ program also passes the prompt text, and an optional caption.

The following is a PROMPT example.

3 Usage:

  PROMPT tabDelimitedArguments

4 Arguments:

 tabDelimitedArguments .. 2 or 3 text strings separated by tabs
1. Response registry value name
The name of a system registry value where the response is returned.

The system registry key is: HKEY_LOCAL_MACHINE\\Software\\Kilowatt SoftwarePrompt

If the value exists, when the PROMPT program is started, it is shown in the response area.

2. Note text
The text that appears in the note area, which is above the response input field.

+3. Caption (optional)
Optional text that is displayed as the caption of the PROMPT program.

Note: a caption should be provided if you expect multiple prompts to be simultaneously displayed.

5 Returns:

6 Buttons:

OK
Concludes PROMPT operation. The prompt value is stored in the system registry.

Cancel
Concludes PROMPT operation, without revising the system registry value.

7 Example:

The following is the r4™ program that displayed the prompt that was shown above

 /* prompter.rex
   demonstration program that uses PROMPT.EXE
 
   usage:
     r4 prompter [color]
 
   examples:
     1. r4 prompter [ input field is initially empty ]
     2. r4 prompter Blue [ shows color in input field ]
 
   refer to PROMPT.HTM for a description of the usage of PROMPT.EXE
 */
 
 'set R4REGISTRYWRITE=Y' /* enable registry writing */
 
 if arg(1) <> '' then
   call value 'HKLM\Software\Kilowatt Software\Prompt[Response]', arg(1), 'Registry'
 
 registryValue = 'Response'
 
 noteText = 'What is your favorite color ?'
 
 caption = 'Prompt -- enter your favorite color'
 
 tab = d2c( 9 )
 
 trace off /* ignore Cancel button error */
 
 prompt registryValue || tab || noteText || tab || caption
 
 if rc = 0 then
   say value( 'HKLM\Software\Kilowatt Software\Prompt[Response]', , 'Registry' )

PROMPT
An r4™ auxiliary rogram.
Version 1.0
Copyright © 2001-2007
All Rights Reserved.
Web: http://www.kilowattsoftware.com/
E-Mail: support@kilowattsoftware.com