| Unit: | SDL_cform | | Class: | TMolForm | | Declaration: | function AsString (fmt: integer): string; |
The method AsString creates a string representing the current molecular formula (as defined by AtCnt, AtNum, AtWgt, and NumAtoms). The parameter fmt may take either 0 or 1, and determines if the atomic weights are included in the resulting string. The format of the formula string is quite simple: each atom type is represented by Wgt/Sy/Num (if fmt equals 1), or by Sy/Num (if fmt = 0). The individual atoms are separated by spaces.
| Example: |
Suppose the molecular formula contains 4 entries (2 C atoms, 5 H atoms, 1 O atom, and another H atom). Therefore AsString(0) returns C2 H5 O H, whereas AsString(1) returns 12C2 1H5 16O 1H.
|
|