home *** CD-ROM | disk | FTP | other *** search
- //************************************************************************
- //
- // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
- // All Rights reserved
- // DataFlex is a registered trademark of Data Access Corporation.
- //
- //
- // $Source: /u3/source.30/product/pkg/RCS/traceobj.pkg,v $
- // $Revision: 1.1 $
- // $State: Exp $
- // $Author: james $
- // $Date: 1992/09/08 14:43:10 $
- // $Locker: $
- //
- // $Log: traceobj.pkg,v $
- //Revision 1.1 1992/09/08 14:43:10 james
- //Initial revision
- //
- //Revision 1.5 92/05/29 14:41:27 lee
- //moved trace keys (again) to Alt+F3 for on/off and Ctrl+F3 for move.
- //
- //Revision 1.4 92/05/22 23:08:08 steve-l
- //Changed trace-toggling key from Shift+F10 to Alt+F10 (Shift+F10 will
- //be the kADD default) and replaced tabs in source file with spaces.
- //
- //Revision 1.3 92/05/14 17:10:00 SWM
- //Updated Copyright slug.
- //
- //Revision 1.2 92/03/09 19:05:19 james
- //Added #CHKSUB directive to insure source
- //only compiled with correct revision of
- //compiler.
- //
- //Revision 1.1 91/10/23 10:23:01 elsa
- //Initial revision
- //
- //************************************************************************/
-
- //************************************************************************
- // File Name: TraceObj.Pkg
- // Creation Date: January 1, 1991
- // Modified Date: June 21, 1991
- // Author(s): Steven A. Lowe
- //
- // This module contains the vTrace class definition, and an instance
- // of it named aTracer.
- //
- // It also defines global keys to toggle tracing on and off and to change
- // the position from the bottom of the screen to the top of the screen and
- // vice-versa. In addition, the global indicator TRCON is defined to reflect
- // whether tracing is on or off.
- //************************************************************************/
-
- #CHKSUB 1 1 // Verify the UI subsystem.
-
- USE UI
-
-
- //
- // This preprocessor command forces the compiler to retain symbols
- //
- #SYM
-
-
- //
- // vtrace class writes output to sequential file ATRACER.TRC so that
- // a crash or reboot won't destroy the output file content.
- //
- class atracer is a trace
- procedure construct_object
- local integer rowcol
- forward send construct_object
- property integer Tracing_State public FALSE
- property integer trow public 0
- property integer tcol public 0
- property integer tref public 0
- property integer file_empty public TRUE
- property string file_name public (module_name(desktop)+".TRC")
- get location to rowcol
- set trow to (hi(rowcol))
- set tcol to (low(rowcol))
- set tref to (hi(rowcol))
- end_procedure
- procedure insert string astr
- local string modname
- get file_name to modname
- showln astr
- if (file_empty(current_object)) begin
- direct_output modname
- set file_empty to false
- end
- else append_output modname
- writeln astr
- close_output
- end_procedure
- procedure key integer val
- end_procedure
- procedure Toggle_Tracing_State
- if (Tracing_State(current_object)) begin
- set Tracing_State to FALSE
- send trace_Switch false false
- end
- else begin
- set Tracing_State to TRUE
- send trace_Switch true false
- end
- end_procedure
- procedure Toggle_Location
- local integer row col ref wason
- get Tracing_State to wason
- if wason send trace_Switch false false
- get trow to row
- get tcol to col
- get tref to ref
- move (ref - row) to row
- set trow to row
- set location to row col
- if wason send trace_Switch true false
- end_procedure
- end_class
-
- //
- // an instance of the vtrace class which sets a global indicator TRCON
- // to reflect whether tracing is on or off. TRCON may be used by
- // developers to guard debugging code.
- //
- object atracer is an atracer
- indicator trcon
- indicate trcon false
- procedure set Tracing_State integer newval
- forward set tracing_state to newval
- indicate trcon as (newval = true)
- end_procedure
- end_object
-
- //
- // desktop (global) keys to toggle tracing and position
- //
- on_key key_alt+key_f3 send Toggle_Tracing_State to atracer
- on_key key_ctrl+key_f3 send Toggle_Location to atracer
-
- //
- // The symbols KickMe, MoveMe, and IMON are defined for historical reasons.
- //
- #REPLACE KickMe Toggle_Tracing_State
- #REPLACE MoveMe Toggle_Location
- #REPLACE IMON TRCON
-