|The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....|
|Home ChemPack CForm TMolForm How to use TMolForm|
|See also: internal representation|
How to use TMolForm
TMolForm can be used in three different ways:
The molecular formula to be displayed can be entered (1) as a specially formatted string by using the property MolFormula, or the method ReadFromString; or (2), by setting the properties NumAtoms, AtNum, AtWgt, and AtCnt. Utilizing the second way requires to know some basic knowledge of the internal representation of molecular formulas.
The colors of the formula can be selected by using the properties ColorTxt, and ColorBkg. The formula may also be displayed with a transparent background by setting the property Transparent to a true value. The visibility of isotopic information can be controlled by the properties IsotopeVis, and UseDeuterium.
TMolForm offers routines to calculate the nominal and natural molecular weight of a given formula (NominalMolWgt,and ChemMolWgt, resp.), to find (FindFormulaExactMass) all possible molecular formulas for a given weight range, and to compare two formulas.
An often needed function is to display plain text instead of a molecular formula. The property ShowAsText allows to switch between displaying the molecular formula and any arbitrary text defined by the property MolFormula.