|
From: Eric M. <em...@mi...> - 2021-04-11 17:00:25
|
Hi Karsten, 'Prompt' is a good idea. One thing I use often in the JSmol Console to query variable values is javascript alert(javascript-expression) or javascript alert(jmolEvaluate(jmol-expression)) -Eric On 4/11/21 12:21 PM, Theis, Karsten W. wrote: > Quick update, I also started using the *prompt* command as a way to > check whether the script reaches a given function or branch in the > algorithm. > > -- > Karsten Theis > Chemical & Physical Sciences Department > Westfield State College > > ------------------------------------------------------------------------ > *From:* Theis, Karsten W. > *Sent:* Sunday, April 11, 2021 12:10 PM > *To:* jmo...@li... <jmo...@li...> > *Subject:* Debugging a script > Hi, > > I was working on a script to morph two structures > <https://proteopedia.org/wiki/images/1/1a/Morph.spt>, and it was > difficult to find the problem because the program just stopped (and > stopped the Jmol app). It turns out I tried to run the compare() > function with an empty selection. > > What I am wondering about are tools (or strategies) that exist to > debug a script. I found the "set (debugging)" commands, and they were > helpful, together with the Java script console. I also discovered that > the Jmol app has a script editor that includes buttons such as Step, > Check, and Halt. What I did not find was documentation for those > buttons, or a tutorial on debugging Jmol scripts in general. > > Do these exist? > > Karsten > > P.S. Just as a heads-up, I would like to include this script in the > macros once it is done, and I could keep it in the same spot on > Proteopedia to provide permanent access unless there is a better place. > > |