home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s4.arc / UPDATERE.MOD < prev    next >
Text File  |  1988-02-14  |  1KB  |  46 lines

  1. (*----------------------------------------------------------------------*)
  2. (*          Update_Review_Pointers --- Update review buffer pointers    *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Update_Review_Pointers;
  6.  
  7. VAR
  8.    L: INTEGER;
  9.    I: INTEGER;
  10.  
  11. BEGIN (* Update_Review_Pointers *)
  12.  
  13.                                    (* Append CR/LF as needed *)
  14.  
  15.    Review_Line := Review_Line + CHR( CR ) + CHR( LF );
  16.  
  17.    FOR I := 1 TO LENGTH( Review_Line ) DO
  18.       BEGIN
  19.                                    (* Increment capture pointer           *)
  20.  
  21.          IF ( Review_Head = Max_Review_Length ) THEN
  22.             Review_Head := 1
  23.          ELSE
  24.             INC( Review_Head );
  25.                                    (* If we wrapped into last char,       *)
  26.                                    (* update last char pointer            *)
  27.  
  28.          IF ( Review_Head = Review_Tail ) THEN
  29.             BEGIN
  30.                IF ( Review_Tail = Max_Review_Length ) THEN
  31.                   Review_Tail := 1
  32.                ELSE
  33.                   INC( Review_Tail );
  34.             END;
  35.  
  36.          IF ( Review_Tail = 0 ) THEN
  37.             Review_Tail := 1;
  38.  
  39.          Review_Buffer^[Review_Head] := Review_Line[I];
  40.  
  41.       END;
  42.  
  43.    Review_Line := '';
  44.  
  45. END   (* Update_Review_Pointers *);
  46.