// debugdoc.prg set debugout on debugout "about to open database" open database southwind debugout "about to open table" use example replace all available with limit - balance debugout "after replace" close databases debugout "after close data" set debugout off // Following line will not be logged: debugout "no need to log this" // end
https://www.lianja.com/doc/index.php/Category:Error_Handling
https://www.lianja.com/doc/index.php/SET_DEBUGOUT
// debugdoc.prg set debugout on debugout "about to open database" open database southwind debugout "about to open table" use example replace all available with limit - balance debugout "after replace" close databases debugout "after close data" set debugout off // Following line will not be logged: debugout "no need to log this" // end
https://www.lianja.com/doc/index.php/DEBUGOUT
proc errorproc astacktrace("a_trace") display memory endproc proc proc1 proc2() endproc proc proc2 proc3() endproc proc proc3 proc4() endproc proc proc4 messagebox("In proc4") crash endproc on error errorproc() proc1()
do doc
Output:
Memory Variables: ------------------------ private(7): A_TRACE Fixed array (refcnt 1) A_TRACE [1,1] pri( 7) Character[ 9] 'errorproc' A_TRACE [1,2] pri( 7) Numeric [ 10] 2 (2.000000000) A_TRACE [2,1] pri( 7) Character[ 5] 'proc4' A_TRACE [2,2] pri( 7) Numeric [ 10] 16 (16.000000000) A_TRACE [3,1] pri( 7) Character[ 5] 'proc3' A_TRACE [3,2] pri( 7) Numeric [ 10] 12 (12.000000000) A_TRACE [4,1] pri( 7) Character[ 5] 'proc2' A_TRACE [4,2] pri( 7) Numeric [ 10] 9 (9.000000000) A_TRACE [5,1] pri( 7) Character[ 5] 'proc1' A_TRACE [5,2] pri( 7) Numeric [ 10] 6 (6.000000000) A_TRACE [6,1] pri( 7) Character[ 7] 'doc.dbo' A_TRACE [6,2] pri( 7) Numeric [ 10] 19 (19.000000000) A_TRACE [7,1] pri( 7) Character[ 8] 'keyboard' A_TRACE [7,2] pri( 7) Numeric [ 10] 0 (0.000000000) ** Total of ** 15 variables defined and 1680 bytes used.
m_lineno = lineno() dialog box "The line is # &m_lineno."
https://www.lianja.com/doc/index.php/LINENO()
// Enable debug logging set debug on
https://www.lianja.com/doc/index.php/SET_DEBUG
// Enable compiled code debug logging set debugcompile on set debug on
https://www.lianja.com/doc/index.php/SET_DEBUGCOMPILE
// Enable compiled code debug logging and command execution trace set debugcompile on set debugtrace on set debug on
https://www.lianja.com/doc/index.php/SET_DEBUGTRACE
set iologging on
https://www.lianja.com/doc/index.php/SET_IOLOGGING
set eventtracking on // Load App
https://www.lianja.com/doc/index.php/SET_EVENTTRACKING
//////////////////////////////////////////////////////////////// // Event delegate for 'interactivechange' event proc page1_section2_ItemCost_interactivechange() debug updateTotal() endproc // or, from Lianja/VFP Command Window: debug main
https://www.lianja.com/doc/index.php/DEBUG
//////////////////////////////////////////////////////////////// // Event delegate for 'interactivechange' event proc page1_section2_ItemCost_interactivechange() debugger updateTotal() endproc // or, from Lianja/VFP Command Window: debugger main
//////////////////////////////////////////////////////////////// // Event delegate for 'click' event function page1_section2_field77_click() { debugger; if (m_orderdate.text.length == 0 && m_shipvia.text.length == 0) { messageBox("No order selection filter criteria has been specified.", "Order selection criteria"); return; } messageBox("You specified orderdate="+m_orderdate.text+", shipvia="+m_shipvia.text, "Order selection criteria"); }
https://www.lianja.com/doc/index.php/DEBUGGER
m_procline = procline() messagebox("The last line number is &m_procline")
https://www.lianja.com/doc/index.php/PROCLINE()
m_procname = procname() dialog message "The error occurred in the procedure &m_procname."
https://www.lianja.com/doc/index.php/PROCNAME()
m_program = program() messagebox("The error occurred in the program; &m_program.")
https://www.lianja.com/doc/index.php/PROGRAM()
// // Database: dbcdoc // Event: dbc_beforeupdate // parameters cDatabase, cTable, cJSON userlog("====================================") userlog("Before Update in "+"dbcdoc database") userlog("Database: " +cDatabase) userlog("Table: " +cTable) if ! isserver() userlog("Update record number: " + etos(recno()) for i = 1 to fldcount() if type("&(field(i))") = "G" loop endif userlog("Field: " + field(i)) userlog("Curval(): " + etos(curval(field(i)))) userlog("Value: " + etos(&(field(i)))) endfor else userlog("JSON: " +base64_decode(cJSON) endif userlog("End of Before Update") userlog("====================================") return .t.
https://www.lianja.com/doc/index.php/USERLOG()