{smcl} {* 29Jun2008}{...} {cmd:help wfdebug} {hline} {title:Title} {p2colset 5 22 28 2}{...} {p2col:{hi:Debugging do-files}}{p_end} {title:When all else fails...} {synoptset 8 tabbed}{...} {p2colset 3 11 11 2}{...} {p2col:{bf:Step 1:}}Update Stata and user written programs (see {helpb update} and {helpb adoupdate}).{p_end} {p2col:{bf:Step 2:}}Start with a clean slate: {cmd:clear all} and {cmd:macro drop _all}; restart Stata; reboot your computer; use another computer.{p_end} {p2col:{bf:Step 3:}}Try a different dataset and different variables.{p_end} {p2col:{bf:Step 4:}}Assume everything could be wrong. Double check things that you are {it:sure} are right.{p_end} {p2col:{bf:Step 5:}}Run the program in steps by using {cmd:/* */} to exclude parts of the do-file.{p_end} {p2col:{bf:Step 6:}}Start over: throw out all of the original code; use a new file; try alternative approaches.{p_end} {p2col:{bf:Step 7:}}Ask for help (see {helpb wfhelp}).{p_end} {p2colset 5 12 12 2} {title:Also see} {helpb wf} INCLUDE help wf_footer