home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s3.arc / READEDIS.MOD < prev    next >
Text File  |  1987-12-28  |  2KB  |  42 lines

  1. (*--------------------------------------------------------------------------*)
  2. (*       Read_Edited_String  -- Read in string and allow keypad editing     *)
  3. (*--------------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Read_Edited_String( VAR S: AnyStr );
  6.  
  7. (*--------------------------------------------------------------------------*)
  8. (*                                                                          *)
  9. (*     Procedure: Read_Edited_String                                        *)
  10. (*                                                                          *)
  11. (*     Purpose:   Provides for editing a string using keypad keys.          *)
  12. (*                                                                          *)
  13. (*     Calling Sequence:                                                    *)
  14. (*                                                                          *)
  15. (*        Read_Edited_String( VAR S : AnyStr );                             *)
  16. (*                                                                          *)
  17. (*           S --- Where input string should be placed                      *)
  18. (*                                                                          *)
  19. (*     Calls:    Edit_String                                                *)
  20. (*                                                                          *)
  21. (*--------------------------------------------------------------------------*)
  22.  
  23. VAR
  24.    Ch : CHAR;
  25.    X  : INTEGER;
  26.    Y  : INTEGER;
  27.    W  : INTEGER;
  28.  
  29. BEGIN (* Read_Edited_String *)
  30.  
  31.    X  := WhereX;
  32.    Y  := WhereY;
  33.  
  34.    W  := MAX( 1 , PRED( Lower_Right_Column - ( PRED( X ) + Upper_Left_Column ) ) );
  35.  
  36.    Ch := Edit_String( S, 255, X, X, Y, W, FALSE, 0 );
  37.  
  38.    IF ( ( LENGTH( S ) = 0 ) AND ( Ch = CHR( ESC ) ) ) THEN
  39.       S := CHR( ESC );
  40.  
  41. END   (* Read_Edited_String *);
  42.