home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TJOCKREF.ZIP / READTTT.TXT < prev    next >
Encoding:
Text File  |  1988-08-21  |  1.7 KB  |  50 lines

  1. !SHORT:ReadLine          Provide line input/editing facility
  2. ReadLine                                                       ReadTTT
  3.           
  4.  
  5.  
  6. Purpose   To provide a line input/editing facility
  7.  
  8. Declaration    ReadLine( X,Y,L,F,B: byte
  9.           var Text: string;
  10.           var Retcode: string);
  11.                     
  12.           X is the X coord of input field (1..80)
  13.           Y is the Y coord of input field (1..25)
  14.           L is the length in chars of input field(1..80)
  15.           F is the foreground color (0..15)
  16.           B is the background color (0..7)
  17.           Text is returned with the users input
  18.           Retcode indicates if user Escaped.
  19.  
  20. Uses CRT, FastTTT, ReadTTT.
  21.  
  22. Remarks   "Text" must be declared as a string variable. This variable
  23.           is returned with the users input. If you want to provide the
  24.           user with a default entry, set the value of Text to the
  25.           desired default string, otherwise set it to null, i.e. ''.
  26.  
  27.           "Retcode" must be an integer variable and it is returned
  28.           with the following values:
  29.                0    successful completion
  30.                1    user ESCaped
  31.  
  32. Example
  33.  
  34.  
  35.                USES CRT, FASTTTT, READTTT;
  36.                VAR
  37.                  THEFILE: STRING;
  38.                  CODE : INTEGER;
  39.                BEGIN
  40.                  THEFILE := '';
  41.                  WRITEAT(10,5,WHITE,BLACK,'ENTER THE FILENAME ===>');
  42.                  REPEAT
  43.                  READLINE(33,5,12,BLACK,LIGHTGRAY, THEFILE, CODE);
  44.                  UNTIL CODE = 0;
  45.                END.
  46.           
  47.  
  48. A 12 character field is presented for the user to input a filename. If
  49. the user ESCapes, the system will re-prompt for a filename.
  50.