HP 3000 Manuals

Lesson 8: INPUT [ MPE V to MPE XL: Getting Started ] MPE/iX 5.0 Documentation


MPE V to MPE XL: Getting Started

Lesson 8:  INPUT 

The new INPUT command can be used interactively to create a user variable
or to assign a value to any user created variable or user modifiable
system variable.  It has two optional parameters:  a prompt string, and a
timed delay.

Example: 

If you want to be able to change the system prompt interactively from its
default colon (:)  to some other character(s), you could use the
following command line in a UDC or in a command file called CHPROMPT:

     INPUT HPPROMPT,"Enter New Prompt: ";wait=15

Executing such a UDC or command file (CHPROMPT) would look like this:
___________________________________________________________________
|                                                                 |
|                                                                 |
|      :CHPROMPT                                                  |
|      Enter New Prompt:                                          |
|                                                                 |
___________________________________________________________________

The command file causes the prompt string Enter New Prompt:  to appear
for up to 15 seconds, giving the user time to respond.  If the user
supplies the response "Hi There..." to the waiting system:
___________________________________________________________________
|                                                                 |
|                                                                 |
|      Enter New Prompt: Hi There...                              |
|      Hi There...                                                |
|                                                                 |
___________________________________________________________________

Hi There...  is then assigned to the variable HPPROMPT. The prompt on the
screen changes immediately.  SHOWVAR HPPROMPT will also confirm the new
value.

Exercises 

13.  What happens in the case of the example given for the INPUT command
     if you don't respond within 15 seconds?  (Try it.)

14.  Create a command file called PR. Use INPUT, without either a prompt 
     string or timed delay, that allows the user to change the MPE XL
     prompt.  Execute the command file and change your prompt to the @
     sign.  Change it back to your normal system prompt.



MPE/iX 5.0 Documentation