Thanks to both of you for your suggestions. I've never used HTML before, but that little bit doesn't look too bad. I'm not sure how to implement it into my project though. I have several forms, each containing many TEdits representing various properties of some chemical - name, color, solubility, formula, etc. The data for each chemical is combined and stored as a string that can be parsed to fill in the TEdits when the form loads. Several years ago I wrote a Visual Basic program that would translate the strings representing the formulas into rtf that would be shown in rich text boxes (as I think they were called). In addition, for entering new formulas, I had basically the same code in each rich text box's OnChange event handler to translate keyboard input into the appropriate rtf "on the fly". (The code consisted essentially of finding each digit in the formula and making it a subscript or superscript depending on what preceded it in the formula.) This worked very nicely and seemed to be efficient - I could store all the data for a substance as a single string instead of storing the formulas separately in rtf format. I'm hoping to do the same in Pascal now. Is it possible to write html code to be that flexible (remember I'm very new at this, so it should be simple), or should I stay with some kind of rtf control?
As for ChemTxt, it looks interesting, but it will take me a while to understand the code. I want the formula fields to look like TEdits. Can ChemTxt do that? And again, is it flexible enough to handle a formula without knowing what it is beforehand?