Wil Macauley wrote: ><grumble> >then you've got to figure out how to put the cursor in the right place >after you've >done all this, if the user made a mistake ></grumble>
What I do in BarFly is to first record the text selection start and end in two variables, then extract a copy of the tune to work on (which itself involves moving the selection positions around), pass that to the preprocessor and on to the parser. Finally I put the text selection back where it was. What gets really tricky is when you need to work back from the final result to the original text (as when the user clicks on a note head to get the equivalent bit of text highlighted in the abc). The preprocessor has to keep track of all the indels it has created so that the program can calculate what position in the original text corresponds to that in the preprocessed copy that the parser works on. I haven't yet figured out how to make this work for nested indels, which is why the program won't allow graphic selection if macros are enabled for display. Phil Taylor To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html
