TPUHELP.HLB  —  READ_LINE
  READ_LINE

     Displays the specified text as a prompt and reads the information
     entered in response.  You can specify the number of characters to be
     read in response.  READ_LINE returns a string that holds data entered
     in the response.

  Syntax

     string2 := READ_LINE [(string1 [,integer])]

  Parameters

     string1    A string to be used as the prompt for input.  By default,
                the text is written in the prompt area on the screen.

     integer    The number of characters to read from the input entered in
                response to the prompt.  The maximum is 132.  If READ_LINE
                terminates because it reaches the limit of characters, the
                last character read becomes the last key.  (See example 2
                below.)

  Comments

     The terminators for READ_LINE are the standard VMS terminators, such as
     CTRL/Z and RETURN.  READ_LINE is not affected by DECTPU key
     definitions; the built-in reads literally all keys except standard VMS
     terminators.

  Examples

     1.  my_prompt := READ_LINE ("Enter key definition:", 1);

         Displays the quoted text in the prompt area, and stores in the
         variable MY_PROMPT the first character of the response.

     2.  The following procedure prompts for three characters, stores them
         in the variable MY_INPUT, and then tests for the last key entered:

         PROCEDURE user_test_last_key
            LOCAL my_key;
            my_input := READ_LINE ("Enter three characters: ", 3);
            !   Press the keys "END"
            my_key := LAST_KEY;
            IF my_key = KEY_NAME ("D")
               THEN
                  MESSAGE ("D key");
               ELSE
                  MESSAGE ("Error...");
            ENDIF;
         ENDPROCEDURE;

  Related topics

     LAST_KEY   READ_CHAR   READ_KEY
Close Help