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....


Declaration:function CompareTo (OtherFormula: TMolForm): integer;

The method CompareTo compares the molecular formula (as defined by AtCnt, AtNum, AtWgt, and NumAtoms) to another molecular formula contained in the parameter OtherFormula. The function returns an integer value with the following meaning:

2 self is contained in OtherFormula
1 OtherFormula is contained in self
0 OtherFormula equals self
-1 OtherFormula and self are neither equal nor contained in each other
-2 either OtherFormula or self is empty

Example: This method is used in the following example program (see for downloading the code): molform

Last Update: 2012-Okt-20