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 MathPack Math2 Class TExtractor TExtractor | |||||
See also: Execute, ExtractionCommands, OnEmit, SourceString, ExtractSubString, ExtractParam, ScanForXMLAttrib, ExtractWordFromString, TMathExpression | |||||
TExtractor |
|||||
The class TExtractor implements an information extraction engine which can be used to extract numeric or string data from complex strings. The principle of TExtractor is quite simple: the input string (property SourceString) is processed by a set of commands which are passed to the extraction engine via the property ExtractionCommands. The results of the extraction are returned by triggering an OnEmit event. This event passes the name and the contents of a variable which has been calculated from the input string. In addition the results can also be stored in the public variable Emission, if the property EmitToAssocArray is set to TRUE.
The extraction commands always operate on the source string using the current position of the execution pointer. The execution pointer can be moved along the source string using several of the commands (such as "pos", "inc", or "find"). TExtractor allows you to define up to a maximum of ME_STACKSIZE (currently 100) variables which can be filled with information obtained from the source string. The variables are Variants (see Delphi manual) and need not be declared - they are created automatically whenever a command references one for the first time. These variables can then be used for calculations using the built-in equation interpreter (which is based on TMathExpression; see the property Expression for details on the available functions).
|