Beginning first live project with Transformer 2
Posted by mholmes on 14 Mar 2008 in Activity log
Started work on converting one of DB's script files from Waterloo Script to XHTML, using the new Transformer. Got quite a long way -- headings, paragraphs, and inline underlines are all handled, and I'm building up a Doc object which can process the input script effectively. XHTML is the best option because it's XML, but it can also be loaded directly into a word processor, which I think is what DB wants. Some points re the app itself:
- Added some counters to give back info at the end of the process on how many scripts were run, as well as the original total of replacements made. The counting is being done in both the single-doc GUI and the file processing for multiple docs, but in the latter case, nothing is returned to the calling function; that reporting will have to be added.
- Added detailed error reporting when code is checked in the Script editing form. Works great! Line, line num, and offending symbol are all reported correctly.
- Discovered that I need to handle such situations as endless loops, which just tie up the app. One option is to add a bound JS function to the beginning of each code block I run, which starts a timer that calls back to Delphi every second or so, so I can monitor and offer to kill the process if it runs too long. But I don't know how to kill it yet. I have a message into the DelphiMoz list about this.
- Minor GUI tweaks.