June 27, 200520 yr I find FileMaker Developer 7's Debug Scripts both useful and frustrating. Step-by-step script execution and breakpoints are quite useful. However, having used interactive debuggers in many programming environments, I'm constantly frustrated by FileMaker's lack of two key debugging features: display field values and script parameters watchpoints -- breakpoints triggered by a specific condition, typically involving a field value While waiting for FileMaker Debug Script to smarten up, I've found a couple of scripting techniques to mimic these features. The following script fragment illustrates the techniques. If [Get ( ScriptParameter ) <> ""] # End If If [] Show Custom Dialog [Get(ScriptParameter)] End If (Note: The "<>" represents a not-equal operator.) If Debug Scripts is disabled, these script steps are invisible. The first "If" executes a comment, and the second "If" never executes the Show Custom Dialog. Setting a breakpoint on the comment and running with Debug Scripts enabled causes the script to stop when a script parameter is passed. At that breakpoint, the Show Custom Dialog step can be selected as the next step to be executed. Having to edit scripts is certainly tedious, but it's better than nothing. -- Ward
June 27, 200520 yr Hi Ward, Script Parameters do show in the debugger window (at the bottom with the script names,) unfortunately it only show the first line of a multi-line parameter. Not having used other debuggers much, the watchpoint thing sounds interesting. Certainly an If[] script step could be used for this, but I'm not sure how it would be implemented within the debugger itself.
June 27, 200520 yr Author I just rushed back from a FM debugging session to correct my posting about showing script parameters, but Ender beat me to it: Script Parameters do show in the debugger window (at the bottom with the script names,) unfortunately it only show the first line of a multi-line parameter. I had been so discouraged about the inability to show field values that I'd overlooked FM's display of the first script parameter. Show Custom Dialog can show several parameters (up to the limits of the fixed-size dialog layout). -- Ward
June 27, 200520 yr Author I've found another shortcoming of FM's debugger. During a debugging session, the Debug menu allows one to remove all breakpoints in in the active script. But there's apparently no way to remove all breakpoints in all scripts in a single operation. I now realize why my script debugging occasionally stops in unexpected places -- it's forgotten breakpoints from an earlier session. -- Ward
Create an account or sign in to comment