In message <[EMAIL PROTECTED]>, Paul Rosen <[EMAIL PROTECTED]> writes >Here's a compromise: perhaps the parser can have a function like the above >that takes only one tune, that is, takes a string that starts with "X:", and >ends just before the next "X:" command. Then there would be a super-parser >(trivial to write) that breaks the string on "X:" boundaries. I'm guessing >that most applications would be concerned with just one tune at a time, >anyway.
OK, we also need a function which can find the total number of tunes in the tune book (ie find the last X:). Also another to very the tune book is in good shape (are all X: markers in order). I think you'd just pass the tune number rather than the tune marker (X:) as that is a detail for the parser. >Callback functions are ok, but they complicate the API. I'd rather aim for >the simplest API we can get away with. Agreed. I use the Microsoft DbgHelp library a lot. You are forced to use Callbacks for shedloads of stuff, much of which (in my opinion without knowing the datastructures involved :-) shouldn't be necessary. Even to find out the number of symbols you have to iterate all the symbols via the callback. Totally crazy - anyway I wasn't advocating that, I would've asked for a separate function unsigned int numTunes(). Stephen -- Stephen Kellett Object Media Limited http://www.objmedia.demon.co.uk RSI Information: http://www.objmedia.demon.co.uk/rsi.html To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html