visual accessory, user query accessory
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.
PROMPT tabDelimitedArguments |
tabDelimitedArguments .. 2 or 3 text strings separated by tabs
|
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' ) |