home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / AIE9009.ZIP / FRAMES.ZIP / NEWTRACE.PRO < prev    next >
Encoding:
Text File  |  1990-02-24  |  1.7 KB  |  58 lines

  1. %%%%%%%%%%%%%% newtrace.pro %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. /* Interp code used in processing trace messages , etc.
  3. */
  4.  
  5. %%%%%%%%%%%%%% trace constants %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6.  
  7.      % if means_reopen is true, this means that the file
  8.      % referred to in its calling context should be closed and
  9.      % reopened for appending instead of being recreated.
  10. means_reopen( reopen ).
  11. means_reopen( append ).
  12. means_reopen( ra     ).
  13.  
  14. %%%%%%%%%%%%%% log file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  15.  
  16. log_file_msg($log file:$).
  17. log_filename($log.log$).
  18.  
  19. init_log_file :-
  20.       init_log_file( create ) .
  21.  
  22. init_log_file( STATUS ) :-
  23.          call( incremental_flag  ),
  24.          log_filename(File ) ,
  25.          trace_message( init_log_trace ,
  26.                         $ in incremental init log rule$,
  27.                         $$),
  28.          (
  29.                call(  zzz_file_created( File )),
  30.                getglobal( zzz_log_file,_ ),
  31.                !
  32.             ;
  33.                log_filename(File ) ,
  34.                create(Handle,File ),
  35.                close(Handle),
  36.                setglobal( zzz_log_file, File ),
  37.                asserta(  zzz_file_created( File ))
  38.           ).
  39.  
  40.  
  41. init_log_file( STATUS ) :-
  42. %   call(log_filename(File)),
  43.          log_filename(File) ,
  44. %   call(log_file_msg(Msg)),
  45.          log_file_msg(Msg) ,
  46.          trace_message( init_log_trace ,
  47.                         $ i r. 2 init log b init_file$,
  48.                         $$),
  49.     init_file(File , log_file_handle, Msg,  STATUS).
  50.  
  51.  
  52. close_log_file :-
  53.      call( incremental_flag),
  54.      !.
  55. close_log_file :-    close_file( log_file_handle  ).
  56.  
  57. %%%%%%%%%%%%%%%%%%% eof %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  58.