home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s4.arc / WRITELOG.MOD < prev    next >
Text File  |  1988-01-06  |  3KB  |  86 lines

  1. (*----------------------------------------------------------------------*)
  2. (*         Write_Log --- Write date/time stamped entry to capture files *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Write_Log( T            : AnyStr;
  6.                      Continuation : BOOLEAN;
  7.                      On_Screen    : BOOLEAN  );
  8.  
  9. (*----------------------------------------------------------------------*)
  10. (*                                                                      *)
  11. (*     Procedure:  Write_Log                                            *)
  12. (*                                                                      *)
  13. (*     Purpose:    Writes date/time stamped entry to capture files.     *)
  14. (*                                                                      *)
  15. (*     Calling Sequence:                                                *)
  16. (*                                                                      *)
  17. (*        Write_Log( T : AnyStr; Continuation: BOOLEAN;                 *)
  18. (*                   On_Screen : BOOLEAN );                             *)
  19. (*                                                                      *)
  20. (*           T            --- Text to be displayed                      *)
  21. (*           Continuation --- TRUE if line continued from previous.     *)
  22. (*           On_Screen    --- TRUE to display text on screen.           *)
  23. (*                                                                      *)
  24. (*      Calls:   Update_Review_Pointers                                 *)
  25. (*                                                                      *)
  26. (*----------------------------------------------------------------------*)
  27.  
  28. VAR
  29.    Prefix: STRING[2];
  30.    S     : AnyStr;
  31.  
  32. (* STATIC VARS *) CONST
  33.    Saved_Time : STRING[8] = '';
  34.    Saved_Date : STRING[8] = '';
  35.  
  36. BEGIN (* Write_Log *)
  37.  
  38.    Saved_Time := TimeString( TimeOfDay , Military_Time );
  39.    Saved_Date := DialDateString;
  40.  
  41.                                    (* Display on screen *)
  42.    IF On_Screen THEN
  43.       WRITELN( T );
  44.                                    (* Add continuation char *)
  45.  
  46.    IF ( NOT Continuation ) THEN
  47.       Prefix := '  '
  48.    ELSE
  49.       Prefix := '+ ';
  50.                                    (* Add time, date stamp *)
  51.  
  52.    T := Prefix + Saved_Date + ' ' + Saved_Time + ' ' + T;
  53.  
  54.                                    (* Write to log file *)
  55.  
  56.    IF ( Log_File_Open AND Logging_On ) THEN
  57.       WRITELN( Log_File, T );
  58.  
  59.                                    (* Add marker characters *)
  60.    T := '>>' + T;
  61.                                    (* Write to capture file *)
  62.    IF Capture_On THEN
  63.       WRITELN( Capture_File, T );
  64.  
  65.                                    (* Write to printer *)
  66.    IF Printer_On THEN
  67.       BEGIN
  68.          Write_Prt_Str( T );
  69.          Write_Prt_Str( CRLF_String );
  70.       END;
  71.                                    (* Point to next slot in review buffer *)
  72.                                    (* and insert text if review mode.     *)
  73.    IF Review_On THEN
  74.       BEGIN
  75.  
  76.          S           := Review_Line;
  77.          Review_Line := T;
  78.  
  79.          Update_Review_Pointers;
  80.  
  81.          Review_Line := S;
  82.  
  83.       END;
  84.  
  85. END   (* Write_Log *);
  86.