You might want to look at using ASSERTS. Very useful for triggering the debug 
process in a controlled way.

-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Gene 
Wirchenko
Sent: Friday, March 21, 2014 5:59 PM
To: [email protected]
Subject: A Use for OKL

Dear Vixens and Reynards:

      OKL is often reviled, but I just found a very good use for it in 
debugging.

      I am debugging a .BeforeRowColChange method.  I want to single-step 
through the method to find the error.  The problem is that I do not want to 
single-step through it unless it is the firing when the form has been selected 
to be closed.  Single-stepping through other firings can cause my form to get 
messed up because the debugger can affect focus.  It is critical in this case 
since I am debugging event firing.

      Here is my code:

Setup (in program startup)
-----

    * Debugging Activation Setup

    private debugstepping
    debugstepping=.f.
    on key label "Ctrl-D" setdebugstepping()

Procedure that sets variable
----------------------------

* setdebugstepping
* Set debugstepping Variable
* Last Modification: 2014-03-21

procedure setdebugstepping

    debugstepping=.t.

    clear typeahead
    =messagebox("debugstepping has been set to .t..",MB_OK,"DEBUGGING")

    return

    endproc

Use (in .BeforeRowColChange())
---

if debugstepping
  set step on
  endif


      Now, I just run my program until I get to where I want to test then press 
Ctrl-D.  The next .BeforeRowColChange() can now be single-stepped through.  The 
other firings are not.

      I wish I had thought of this idea years ago.  Debugging connected with 
event firing has been so awkward.

Sincerely,

Gene Wirchenko


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/DF1EEF11E586A64FB54A97F22A8BD04422A71B02B7@ACKBWDDQH1.artfact.local
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to