TFPEnvironmentScope

Use TFPEnvironmentScope to insulate a block from the surrounding environment. Its constructor saves the current environment (as a TFPInactiveEnvironment object) and modifies the current environment as does a TFPEnvironmentModfier constructor.

Its destructor restores that environment. The inactive environment saved by the constructor is accessible from the member function GetSavedEnvironment, but it cannot be modified.

TIP For an example of a calculation whose environment manipulations would best be insulated from the rest of an application, consider using double floating-point values (with 53 bits of precision) to evaluate a 32-bit integer expression in which integer overflow might otherwise occur. Setting rounding toward zero to match other integer calculations would not pertain to the rest of the calculation, nor would any floating-point exceptions that arose while computing the integer value.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker